Troubleshooting script elevator
This commit is contained in:
@@ -327,7 +327,7 @@ Function Test-AsAdmin () {
|
|||||||
Add-LogEntry "Performing script elevation, please approve the admin prompt"
|
Add-LogEntry "Performing script elevation, please approve the admin prompt"
|
||||||
Start-Sleep -Seconds 3
|
Start-Sleep -Seconds 3
|
||||||
if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) {
|
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
|
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine
|
||||||
Exit
|
Exit
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user