Skip to content

Commit

Permalink
Use -NoProfile when invoking pwsh in Pester tests (#2061)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatejKafka authored Feb 25, 2025
1 parent 9fa10d4 commit 4f0c07a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Tests/Engine/InvokeScriptAnalyzer.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ Describe "-ReportSummary switch" {
}

It "prints the correct report summary using the -NoReportSummary switch" {
$result = & $pwshExe -Command "Import-Module '$pssaPath'; Invoke-ScriptAnalyzer -ScriptDefinition gci -ReportSummary"
$result = & $pwshExe -NoProfile -Command "Import-Module '$pssaPath'; Invoke-ScriptAnalyzer -ScriptDefinition gci -ReportSummary"

"$result" | Should -BeLike $reportSummaryFor1Warning
}
Expand Down
2 changes: 1 addition & 1 deletion build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ function Test-ScriptAnalyzer
}
else {
$powershell = (Get-Process -id $PID).MainModule.FileName
& ${powershell} -Command $scriptBlock
& ${powershell} -NoProfile -Command $scriptBlock
}
}
finally {
Expand Down

0 comments on commit 4f0c07a

Please sign in to comment.