Miscellaneous minor updates to WinCompat (#11980)

* Filter PSModulePath when starting PS 5.1. Removing PS-Core-specific paths from PSModulePath of WinCompat process (Windows PS).
* Make implicit WinCompat respect NoClobber and Scope parameters
* Add ErrorAction.Ignore when searching for WinPSCompatSession
This commit is contained in:
Andrew
2020-03-10 11:31:44 +05:00
committed by GitHub
parent 86ea202bae
commit 704b0e74ed
4 changed files with 81 additions and 6 deletions
@@ -165,9 +165,9 @@ Describe "SxS Module Path Basic Tests" -tags "CI" {
It 'Windows PowerShell does not inherit PowerShell paths' -Skip:(!$IsWindows) {
$out = powershell.exe -noprofile -command '$env:PSModulePath'
$out | Should -Not -Contain $expectedUserPath
$out | Should -Not -Contain $expectedSharedPath
$out | Should -Not -Contain $expectedSystemPath
$out | Should -Not -BeLike "*$expectedUserPath*"
$out | Should -Not -BeLike "*$expectedSharedPath*"
$out | Should -Not -BeLike "*$expectedSystemPath*"
}
It 'Windows PowerShell inherits user added paths' -Skip:(!$IsWindows) {