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
Write-Host "Checking for Administrator permission..." | |
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { | |
Write-Warning "Insufficient permissions to run this script. Open the PowerShell console as administrator and run this script again." | |
Break | |
} else { | |
Write-Host "Running as administrator — continuing execution..." -ForegroundColor Green | |
} | |
$patchfile = $args[0] | |