Skip to content

adding -NoProfile to the areas where we inovke powershell #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions kvm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down