Skip to content

Commit 5833d08

Browse files
committed
Use -NoProfile when invoking pwsh in Pester tests
1 parent 36d6886 commit 5833d08

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Tests/Engine/InvokeScriptAnalyzer.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ Describe "-ReportSummary switch" {
604604
}
605605

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

609609
"$result" | Should -BeLike $reportSummaryFor1Warning
610610
}

build.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ function Test-ScriptAnalyzer
351351
}
352352
else {
353353
$powershell = (Get-Process -id $PID).MainModule.FileName
354-
& ${powershell} -Command $scriptBlock
354+
& ${powershell} -NoProfile -Command $scriptBlock
355355
}
356356
}
357357
finally {

0 commit comments

Comments
 (0)