Created
July 25, 2016 14:47
-
-
Save jcefoli/619cb61b101db8d019cd294cfcd7a560 to your computer and use it in GitHub Desktop.
Check if Powershell Script is Unsigned, Set it, and Terminate the Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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