Thu. Jun 16th, 2022


# Written by Michael Pomfret


# This script checks whether the script is running as admin, if not then starts as admin.


If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] “Administrator”))


$arguments = “& ‘” + $myinvocation.mycommand.definition + “‘”

Start-Process powershell -Verb runAs -ArgumentList $arguments




Write-Host -f Cyan “Red ugly warning about set-executionPolicy..”

sleep 2

Write-Host -f Green “OK”

Write-Host “”

This website uses cookies. By continuing to use this site, you accept our use of cookies.