Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Verifies that the script is running elevated
- If (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
- If ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) {
- $Cx = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
- Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList "-noexit",$Cx
- Exit
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement