From 5421febdd13fa4499a8018ac13c48bb8c7ffd93f Mon Sep 17 00:00:00 2001 From: Ben Claussen Date: Mon, 13 Mar 2023 09:42:08 -0400 Subject: [PATCH] Update `deploy.ps1` to remove trailing whitespaces from psd1 --- deploy.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deploy.ps1 b/deploy.ps1 index 5736c2e..aecf108 100644 --- a/deploy.ps1 +++ b/deploy.ps1 @@ -64,6 +64,7 @@ $FunctionPath = "$PSScriptRoot\Functions" $OutputDirectory = "$PSScriptRoot\$ModuleName" $PSD1OutputPath = "$OutputDirectory\$ModuleName.psd1" $PSM1OutputPath = "$OutputDirectory\$ModuleName.psm1" +$PS1FunctionFiles = Get-ChildItem $FunctionPath -Filter "*.ps1" -Recurse | Sort-Object Name Write-Host "Removing whitespace from files" -ForegroundColor Green @@ -71,7 +72,6 @@ Invoke-ScriptAnalyzer -Path $FunctionPath -IncludeRule 'PSAvoidTrailingWhitespac Write-Host "Concatenating [$($PS1FunctionFiles.Count)] PS1 files from $FunctionPath" -$PS1FunctionFiles = Get-ChildItem $FunctionPath -Filter "*.ps1" -Recurse | Sort-Object Name "" | Out-File -FilePath $ConcatenatedFilePath -Encoding utf8 @@ -165,6 +165,8 @@ if (-not (Test-Path $OutputDirectory)) { Write-Host " Copying psd1" Copy-Item -Path "$PSScriptRoot\$ModuleName.psd1" -Destination $PSD1OutputPath -Force +Write-Host " Removing trailing whitespaces from psd1" +Invoke-ScriptAnalyzer -Path $PSD1OutputPath -IncludeRule 'PSAvoidTrailingWhitespace' -Fix Write-Host " Copying psm1" Copy-Item -Path $ConcatenatedFilePath -Destination $PSM1OutputPath -Force