Skip to content

Instantly share code, notes, and snippets.

#Requires -RunAsAdministrator
#Requires -Version 5
if (($PSVersionTable.PSVersion.Major) -lt 5) {
Write-Output "PowerShell 5 or later is required to run bootstrap."
Write-Output "Upgrade PowerShell: https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell"
break
}
# show notification to change execution policy:
$allowedExecutionPolicy = @('Unrestricted', 'RemoteSigned', 'ByPass')
if ((Get-ExecutionPolicy).ToString() -notin $allowedExecutionPolicy) {
#Requires -Version 5
#Requires -RunAsAdministrator
[CmdletBinding()]
param (
[Parameter()]
[ValidateSet("Minimal", "Basic", "Full")]
$Plevel
)
Write-Output "Level: $Plevel"
function Write-Error([string]$message) {