Skip to content

Instantly share code, notes, and snippets.

@jcefoli
Created July 25, 2016 14:47
Show Gist options
  • Save jcefoli/619cb61b101db8d019cd294cfcd7a560 to your computer and use it in GitHub Desktop.
Save jcefoli/619cb61b101db8d019cd294cfcd7a560 to your computer and use it in GitHub Desktop.
Check if Powershell Script is Unsigned, Set it, and Terminate the Script
$Policy = "Unrestricted"
If ((get-ExecutionPolicy) -ne $Policy) {
Write-Host "Script Execution is disabled. Enabling it now"
Set-ExecutionPolicy $Policy -Force
Write-Host "Please Re-Run this script in a new powershell enviroment"
Exit
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment