Add Windows PowerShell PSModulePath by default on Windows (#4132)

This change is only for Windows and appends the Windows PowerShell PSModulePath on startup via a default profile. Depending on the data/feedback we get, we can decide what to do (opt-in vs opt-out) as we get closer to a release candidate.
This commit is contained in:
Steve Lee
2017-07-07 09:43:37 -07:00
committed by Dongbo Wang
parent 51c7861da6
commit 7bce1653f3
5 changed files with 41 additions and 10 deletions
@@ -93,4 +93,19 @@ Describe "SxS Module Path Basic Tests" -tags "CI" {
$paths -contains $fakePSHomeModuleDir | Should Be $true
$paths -contains $customeModules | Should Be $true
}
It "Default PowerShell profile appends Windows PowerShell PSModulePath only on Windows" {
$psmodulepath = & $powershell -nologo -c '$env:PSModulePath'
if ($IsWindows)
{
$psmodulepath[0] | Should Match "Warning" # for Windows, there is a warning that path being appended
$psmodulepath[1] | Should Match "WindowsPowerShell"
}
else
{
$psmodulepath[0] | Should Not Match "WindowsPowerShell"
}
}
}