File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -164,10 +164,18 @@ function Elevate {
164164 }
165165 else {
166166 Show-Output " This script requires admin access. Elevating."
167- Show-Output " $command "
167+ Show-Output " ${command} "
168+ $ArgumentList = (' -NoProfile -NoExit -Command "cd {0}; {1} -Elevated"' -f ($pwd , $command ))
168169 # Use newer PowerShell if available.
169170 if (Test-CommandExists " pwsh" ) {$shell = " pwsh" } else {$shell = " powershell" }
170- Start-Process - FilePath " $shell " - Verb RunAs - ArgumentList (' -NoProfile -NoExit -Command "cd {0}; {1}" -Elevated' -f ($pwd , $command ))
171+ # Use Windows Terminal if available
172+ # if (Test-CommandExists "wt") {
173+ # # https://stackoverflow.com/a/63163528
174+ # # This has problems in parsing the semicolon
175+ # Start-Process -FilePath "wt" -Verb RunAs -ArgumentList ('new-tab {0} {1}' -f ($shell, $ArgumentList))
176+ # } else {
177+ Start-Process - FilePath " $shell " - Verb RunAs - ArgumentList " ${ArgumentList} "
178+ # }
171179 Show-Output " The script has been started in another window. You can close this window now." - ForegroundColor Green
172180 }
173181 Exit
You can’t perform that action at this time.
0 commit comments