Created
April 6, 2022 14:38
-
-
Save nyanhp/145f715e41ea84b8247b66ea13aaaa26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (-not (Test-IsAdministrator)) | |
{ | |
Write-Host -ForegroundColor Magenta 'Not an Admin :(' | |
Start-Process -Verb runAs -FilePath (Get-Process -Id $pid).Path -ArgumentList "-File $PSScriptRoot" -WindowStyle Hidden | |
} | |
Write-Host -ForegroundColor Magenta 'Admin :)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment