You know how if you\'re the administrative user of a system and you can just right click say, a batch script and run it as Administrator without entering the administrator p
You can easily add some registry entries to get a "Run as administrator" context menu for .ps1
files:
New-Item -Path "Registry::HKEY_CLASSES_ROOT\Microsoft.PowershellScript.1\Shell\runas\command" `
-Force -Name '' -Value '"c:\windows\system32\windowspowershell\v1.0\powershell.exe" -noexit "%1"'
(updated to a simpler script from @Shay)
Basically at HKCR:\Microsoft.PowershellScript.1\Shell\runas\command
set the default value to invoke the script using Powershell.