From 6ca9bbfe4fcc57163c7dee4a250451ad9ae0d3cf Mon Sep 17 00:00:00 2001 From: "Steve Lee [MSFT]" Date: Wed, 23 Aug 2017 20:18:53 -0700 Subject: [PATCH] removed appending WindowsPowerShell PSModulePath --- build.psm1 | 6 ------ .../Microsoft.PowerShell_profile.ps1 | 10 ---------- test/powershell/engine/Module/ModulePath.Tests.ps1 | 14 -------------- 3 files changed, 30 deletions(-) delete mode 100644 src/powershell-win-core/Microsoft.PowerShell_profile.ps1 diff --git a/build.psm1 b/build.psm1 index 84f3913f79e..e0ffebbbd1e 100644 --- a/build.psm1 +++ b/build.psm1 @@ -505,12 +505,6 @@ Fix steps: Pop-Location } - # copy PowerShell host profile if Windows - if ($Environment.IsWindows) - { - Copy-Item -Path "$PSScriptRoot/src/powershell-win-core/Microsoft.PowerShell_profile.ps1" -Destination $publishPath -Force - } - if ($Environment.IsRedHatFamily) { # add two symbolic links to system shared libraries that libmi.so is dependent on to handle # platform specific changes. This is the only set of platforms needed for this currently diff --git a/src/powershell-win-core/Microsoft.PowerShell_profile.ps1 b/src/powershell-win-core/Microsoft.PowerShell_profile.ps1 deleted file mode 100644 index df6ea82ee87..00000000000 --- a/src/powershell-win-core/Microsoft.PowerShell_profile.ps1 +++ /dev/null @@ -1,10 +0,0 @@ -# Default profile for all users for PowerShell host - -if ($IsWindows) -{ - # Add Windows PowerShell PSModulePath to make it easier to discover potentially compatible PowerShell modules - # If a Windows PowerShell module works or not, please provide feedback at https://github.com/PowerShell/PowerShell/issues/4062 - - Write-Warning "Appended Windows PowerShell PSModulePath" - $env:psmodulepath += ";${env:userprofile}\Documents\WindowsPowerShell\Modules;${env:programfiles}\WindowsPowerShell\Modules;${env:windir}\system32\WindowsPowerShell\v1.0\Modules\" -} diff --git a/test/powershell/engine/Module/ModulePath.Tests.ps1 b/test/powershell/engine/Module/ModulePath.Tests.ps1 index 728d5355dd9..9d011ff468e 100644 --- a/test/powershell/engine/Module/ModulePath.Tests.ps1 +++ b/test/powershell/engine/Module/ModulePath.Tests.ps1 @@ -94,18 +94,4 @@ Describe "SxS Module Path Basic Tests" -tags "CI" { $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" - } - } }