Answer: In PowerShell 2.0 we have the option to control what type of scripts we can run by applying a script execution policy.
In PowerShell 2.0 we have three types of Execution Policy and they are:
- Allsigned
All scripts needs to have a trusted signature
- Remotesigned
All scripts downloaded from the internet needs to have trusted signature
- Unrestricted
Runs any script regardless if it’s signed or not
To check the current Execution Policy applied to your computer \ server run the following cmdlet:
Get-executionpolicy
To set the policy type:
Set-executionpolicy unrestricted