@@ -122,38 +122,7 @@ else {
122122Write-Verbose " Setting the placeholders for $ ( $outPSDFile ) "
123123Set-Content - Path $outPSDFile - Value $PSDfileContent - Encoding utf8BOM - Force
124124
125- Write-Output " Running PSScriptAnalyzer on $ ( $MigrateFunction.name ) ..."
126- $ResultPS1 = foreach ($ps1 in $MigrateFunction.FullName ) {
127- write-output " Är på fil $ ( $ps1 ) "
128- $PSAnalyzerPS1 = Invoke-ScriptAnalyzer - Path $ps1 - ReportSummary
129- <# if ($null -ne $ps1) {
130- $ps1Name = $ps1 -split "/" -replace ".ps1" | Select-Object -Last 1
131- Write-Verbose "Running PSScriptAnalyzer on $($ps1Name).ps1..."
132- $PSAnalyzerPS1 = Invoke-ScriptAnalyzer -Path $ps1 -ReportSummary
133- if ($null -ne $PSAnalyzerPS1) {
134- $PSAnalyzerPS1 | select-object * | Out-File -Encoding UTF8BOM -FilePath $(Join-Path -Path $TestPath -ChildPath "PSScriptAnalyzer_$($ps1Name)_$($TodaysDate).md")
135- }
136- else {
137- Write-Output "0 rule violations found." | Out-File -Encoding UTF8BOM -FilePath $(Join-Path -Path $TestPath -ChildPath "PSScriptAnalyzer_$($ps1Name)_$($TodaysDate).md")
138- }
139- $PSAnalyzerPS1
140- }#>
141- }
142- <#
143- Write-Output "Running PSScriptAnalyzer on $($outPSDFile) and $($outPSMFile)..."
144- $CheckPSA = @($outPSDFile, $outPSMFile)
145- $ResultPSDPSM = foreach ($file in $CheckPSA) {
146- $psdPSMName = $file -split "/" | Select-Object -Last 1
147- Write-Verbose "Running PSScriptAnalyzer on $($psdPSMName)..."
148- $PSAnalyzer = Invoke-ScriptAnalyzer -Path $file -ReportSummary
149- if ($null -ne $PSAnalyzer) {
150- $PSAnalyzer | select-object * | Out-File -Encoding UTF8BOM -FilePath $(Join-Path -Path $TestPath -ChildPath "PSScriptAnalyzer_$($psdPSMName)_$($TodaysDate).md")
151- }
152- else {
153- Write-Output "0 rule violations found." | Out-File -Encoding UTF8BOM -FilePath $(Join-Path -Path $TestPath -ChildPath "PSScriptAnalyzer_$($psdPSMName)_$($TodaysDate).md")
154- }
155- $PSAnalyzer
156- }#>
125+
157126
158127# Import the module and save the Get-Help files to the $HelpPath for the module, files get saved in .md format
159128Write-Verbose " Importing $ ( $ModuleName ) to the session..."
@@ -168,8 +137,7 @@ foreach ($m in $mCommands) {
168137 }
169138}
170139
171- # Write-Output "`n== Summery of PSScriptAnalyzer =="
172- # $ResultPS1
140+ Write-Output " `n == Summery of PSScriptAnalyzer =="
173141# $ResultPSDPSM
174142
175143# if ($ResultPS1.Severity -contains "Warning" -or $ResultPSM.Severity -contains "Warning") {
0 commit comments