Hi everyone, let talk a little bit really little =]
I want to talk a little about Execution Policy option in Powershell.
What do the following options mean?
When we are downloading any PowerShell script from Technet or any websites and then trying to run them we may encounter this error:
File C:\Common\Scripts\hello.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details:
Before I am showing you how to change them I want you to introduce them:
This is mode comes as default, applied on operation system, we can’t run any scripts.
Allow for scripts to runs, as long as they are under the digital signature of certified company.
Allow for scripts to run but it’s required that all scripts you have been download will be signed, well, is there a doubt with TechNet scripts? probably there is. When you are running a local script, that script already signed by your Windows (You can open the MMC and then go to Certificate and see PowerShell certificates)
On Windows server 2012 the default mode is “RemoteSigned“.
It is allowing you to run any script you want, In order to change your PowerShell mode on your Windows server or Windows 7, 10 you need to open PowerShell and run
Get-ExecutionPolicy ( just to know which mode I am)
And then change it using: