Troubleshooting script elevator

This commit is contained in:
2025-03-01 17:07:30 -06:00
parent 99a82e5e95
commit e7c447d265

View File

@@ -327,7 +327,7 @@ Function Test-AsAdmin () {
Add-LogEntry "Performing script elevation, please approve the admin prompt"
Start-Sleep -Seconds 3
if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) {
$CommandLine = "$AdditionalFlags -File `"" + $MyInvocation.MyCommand.Path + "`" " + (Save-Parameters $MyInvocation.BoundParameters) + " " + $MyInvocation.UnboundArguments
$CommandLine = "-ExecutionPolicy Bypass -File `"" + $MyInvocation.MyCommand.Path + "`" " + (Save-Parameters $MyInvocation.BoundParameters) + " " + $MyInvocation.UnboundArguments
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine
Exit
}