File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,22 +123,22 @@ Write-Verbose "Setting the placeholders for $($outPSDFile)"
123123Set-Content - Path $outPSDFile - Value $PSDfileContent - Encoding utf8BOM - Force
124124
125125Write-Output " Running PSScriptAnalyzer on $ ( $MigrateFunction.name ) ..."
126- <# $ResultPS1 = foreach ($ps1 in $MigrateFunction.FullName) {
126+ $ResultPS1 = foreach ($ps1 in $MigrateFunction.FullName ) {
127127 write-output " Är på fil $ ( $ps1 ) "
128128 if ($null -ne $ps1 ) {
129129 $ps1Name = $ps1 -split " /" -replace " .ps1" | Select-Object - Last 1
130130 Write-Verbose " Running PSScriptAnalyzer on $ ( $ps1Name ) .ps1..."
131131 $PSAnalyzerPS1 = Invoke-ScriptAnalyzer - Path $ps1 - ReportSummary
132- # if ($null -ne $PSAnalyzerPS1) {
133- # $PSAnalyzerPS1 | select-object * | Out-File -Encoding UTF8BOM -FilePath $(Join-Path -Path $TestPath -ChildPath "PSScriptAnalyzer_$($ps1Name)_$($TodaysDate).md")
134- # }
135- # else {
136- # Write-Output "0 rule violations found." | Out-File -Encoding UTF8BOM -FilePath $(Join-Path -Path $TestPath -ChildPath "PSScriptAnalyzer_$($ps1Name)_$($TodaysDate).md")
137- # }
132+ if ($null -ne $PSAnalyzerPS1 ) {
133+ $PSAnalyzerPS1 | select-object * | Out-File - Encoding UTF8BOM - FilePath $ (Join-Path - Path $TestPath - ChildPath " PSScriptAnalyzer_$ ( $ps1Name ) _$ ( $TodaysDate ) .md" )
134+ }
135+ else {
136+ Write-Output " 0 rule violations found." | Out-File - Encoding UTF8BOM - FilePath $ (Join-Path - Path $TestPath - ChildPath " PSScriptAnalyzer_$ ( $ps1Name ) _$ ( $TodaysDate ) .md" )
137+ }
138138 $PSAnalyzerPS1
139139 }
140140}
141-
141+ <#
142142Write-Output "Running PSScriptAnalyzer on $($outPSDFile) and $($outPSMFile)..."
143143$CheckPSA = @($outPSDFile, $outPSMFile)
144144$ResultPSDPSM = foreach ($file in $CheckPSA) {
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments