Skip to content

Instantly share code, notes, and snippets.

<#
Set-ExecutionPolicy Bypass -Scope LocalMachine -Force
iwr https://gist.githubusercontent.com/radtkedev/d8c4121931633eca04ca625d09ff1a11/raw/Windows-11-Setup.ps1 -OutFile C:\setup.ps1
& C:\setup.ps1
#>
if (!(New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Start-Process -FilePath "powershell.exe" -ArgumentList ("-File", $MyInvocation.MyCommand.Source, $args | %{ $_ }) -Verb RunAs; exit
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Various PowerShell Snippets