|
@@ -1,3 +1,11 @@
|
|
|
|
+If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
|
|
|
|
+ $arguments = "&" + $MyInvocation.MyCommand.Definition + ""
|
|
|
|
+ Write-Host "You didn't run this script as an Administrator. This script will self elevate to run as an Administrator." -ForegroundColor "White"
|
|
|
|
+ Start-Sleep 1
|
|
|
|
+ Start-Process "powershell.exe" -Verb RunAs -ArgumentList $arguments
|
|
|
|
+ Break
|
|
|
|
+}
|
|
|
|
+
|
|
Add-Type -AssemblyName System.Windows.Forms
|
|
Add-Type -AssemblyName System.Windows.Forms
|
|
[System.Windows.Forms.Application]::EnableVisualStyles()
|
|
[System.Windows.Forms.Application]::EnableVisualStyles()
|
|
|
|
|