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:
Steve Lee
2017-03-15 12:04:28 -07:00
committed by Travis Plunk
parent e5da3516d9
commit 76de340e79
18 changed files with 81 additions and 76 deletions
@@ -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