From da5c0fdf55049f6414584dff37d9728d8ef0bcc8 Mon Sep 17 00:00:00 2001 From: Sayed Ibrahim Hashimi Date: Thu, 30 Oct 2014 13:35:55 -0700 Subject: [PATCH] adding -NoProfile to the areas where we inovke powershell --- kvm.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kvm.ps1 b/kvm.ps1 index c38bfa7c76d0..f2918bea1b92 100644 --- a/kvm.ps1 +++ b/kvm.ps1 @@ -97,7 +97,7 @@ function Kvm-Global-Setup { If (Needs-Elevation) { - $arguments = "-ExecutionPolicy unrestricted & '$scriptPath' setup -global -wait" + $arguments = "-NoProfile -ExecutionPolicy unrestricted & '$scriptPath' setup -global -wait" Start-Process "$psHome\powershell.exe" -Verb runAs -ArgumentList $arguments -Wait Write-Host "Adding $kvmBinPath to process PATH" Set-Path (Change-Path $env:Path $kvmBinPath ($kvmBinPath)) @@ -145,7 +145,7 @@ function Kvm-Global-Upgrade { $alias="default" $versionOrAlias = Kvm-Find-Latest $selectedRuntime $selectedArch If (Needs-Elevation) { - $arguments = "-ExecutionPolicy unrestricted & '$scriptPath' install '$versionOrAlias' -global $(Requested-Switches) -wait" + $arguments = "-NoProfile -ExecutionPolicy unrestricted & '$scriptPath' install '$versionOrAlias' -global $(Requested-Switches) -wait" Start-Process "$psHome\powershell.exe" -Verb runAs -ArgumentList $arguments -Wait Kvm-Set-Global-Process-Path $versionOrAlias break @@ -296,7 +296,7 @@ param( if ($isGlobal) { if (Needs-Elevation) { - $arguments = "-ExecutionPolicy unrestricted & '$scriptPath' install '$versionOrAlias' -global $(Requested-Switches) -wait" + $arguments = "-NoProfile -ExecutionPolicy unrestricted & '$scriptPath' install '$versionOrAlias' -global $(Requested-Switches) -wait" Start-Process "$psHome\powershell.exe" -Verb runAs -ArgumentList $arguments -Wait Kvm-Set-Global-Process-Path $versionOrAlias break @@ -416,7 +416,7 @@ param( [string] $versionOrAlias ) If (Needs-Elevation) { - $arguments = "-ExecutionPolicy unrestricted & '$scriptPath' use '$versionOrAlias' -global $(Requested-Switches) -wait" + $arguments = "-NoProfile -ExecutionPolicy unrestricted & '$scriptPath' use '$versionOrAlias' -global $(Requested-Switches) -wait" Start-Process "$psHome\powershell.exe" -Verb runAs -ArgumentList $arguments -Wait Kvm-Set-Global-Process-Path $versionOrAlias break