Executing a PowerShell script

If you are facing following error message while trying to execute a PowerShell .PS1 file then the execution policy might be Restricted.


To check the execution policy execute following command:



The Restricted execution policy is the default PowerShell execution policy and it does not allow to run PowerShell script files but one can just execute individual commands. To enable execution of PowerShell script set appropriate execution policy for PowerShell. To know more about PowerShell execution policies click here. To set the PowerShell execution policy to RemoteSigned start PowerShell with Administrator privileges and execute following command:


Now from the PowerShell execute following command:

Or if you are already in the directory C:\Filepath execute following command:

Comments

Make Money from Surveys

Popular posts from this blog

Schema.Object has an unresolved reference to Schema

The current master key cannot be decrypted

There is insufficient memory available in the buffer pool