mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
corrected use of PSModulePath casing to be consistent with Windows PowerShell (#3255)
* corrected use of PSModulePath casing to be consistent with Windows PowerShell addresses #3227 * addressing review feedback make "PSModulePath" into const fixed some test workarounds due to failures for external reasons that wasn't meant to be checked in * addressing review feedback make "PSModulePath" into const fixed some test workarounds due to failures for external reasons that wasn't meant to be checked in
This commit is contained in:
@@ -32,18 +32,18 @@ Describe "SxS Module Path Basic Tests" -tags "CI" {
|
||||
}
|
||||
|
||||
BeforeEach {
|
||||
$originalModulePath = $env:PSMODULEPATH
|
||||
$originalModulePath = $env:PSModulePath
|
||||
}
|
||||
|
||||
AfterEach {
|
||||
$env:PSMODULEPATH = $originalModulePath
|
||||
$env:PSModulePath = $originalModulePath
|
||||
}
|
||||
|
||||
|
||||
It "validate sxs module path" {
|
||||
|
||||
$env:PSMODULEPATH = ""
|
||||
$defaultModulePath = & $powershell -nopro -c '$env:PSMODULEPATH'
|
||||
$env:PSModulePath = ""
|
||||
$defaultModulePath = & $powershell -nopro -c '$env:PSModulePath'
|
||||
|
||||
$paths = $defaultModulePath -split [System.IO.Path]::PathSeparator
|
||||
|
||||
@@ -64,8 +64,8 @@ Describe "SxS Module Path Basic Tests" -tags "CI" {
|
||||
try {
|
||||
|
||||
## PSHome module path derived from another powershell core instance should be ignored
|
||||
$env:PSMODULEPATH = $fakePSHomeModuleDir
|
||||
$newModulePath = & $powershell -nopro -c '$env:PSMODULEPATH'
|
||||
$env:PSModulePath = $fakePSHomeModuleDir
|
||||
$newModulePath = & $powershell -nopro -c '$env:PSModulePath'
|
||||
$paths = $newModulePath -split [System.IO.Path]::PathSeparator
|
||||
|
||||
$paths.Count | Should Be 3
|
||||
@@ -85,8 +85,8 @@ Describe "SxS Module Path Basic Tests" -tags "CI" {
|
||||
|
||||
## non-pshome module path derived from another powershell core instance should be preserved
|
||||
$customeModules = Join-Path -Path $TestDrive -ChildPath 'CustomModules'
|
||||
$env:PSMODULEPATH = $fakePSHomeModuleDir, $customeModules -join ([System.IO.Path]::PathSeparator)
|
||||
$newModulePath = & $powershell -nopro -c '$env:PSMODULEPATH'
|
||||
$env:PSModulePath = $fakePSHomeModuleDir, $customeModules -join ([System.IO.Path]::PathSeparator)
|
||||
$newModulePath = & $powershell -nopro -c '$env:PSModulePath'
|
||||
$paths = $newModulePath -split [System.IO.Path]::PathSeparator
|
||||
|
||||
$paths.Count | Should Be 5
|
||||
|
||||
Reference in New Issue
Block a user