Skip to content

Commit

Permalink
Fix: self elevation fails when location contains space #187
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardog authored Oct 6, 2022
1 parent 12438bb commit fca9d1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/docs/tips/script-self-elevation.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function Test-IsAdmin {
if ((Test-IsAdmin) -eq $false) {
Write-Warning "This script requires local admin privileges. Elevating..."
gsudo "$($MyInvocation.MyCommand.Source)" $args
gsudo "& '$($MyInvocation.MyCommand.Source)'" $args
if ($LastExitCode -eq 999 ) {
Write-error 'Failed to elevate.'
}
Expand Down

0 comments on commit fca9d1d

Please sign in to comment.