PowerShell: File is not digitally Signed

Introduction to Problem

PowerShell scripting is something which is specifically meant of SharePoint Administrators; they use the same in their day to day work activity. PowerShell script is much more powershell; we can easily do things which we can not do through SharePoint UI.

However; there are cases where Admins don't want users to execute PowerShell scripts on their machine.The Set-ExecutionPolicy cmdlet will enable you to understand which PowerShell scripts you want to execute on machine. While executing the scripts on Dev machine you may have come across this error message " File is not digitally Signed ". This error occurs as your Execution policy is not allowing you to execute the PowerShell Script ; before you run the script you need to set execution policy to something which allows you to run the script.
 
 
 

There are four different types of execution policies.

  1. Restricted: No script can be run.

  2. AllSigned: Only script signed by trusted publisher can be run.

  3. RemoteSigned: Downloaded script must to signed by trusted publisher before you run.

  4. Unrestricted: No restriction all script can be run.
Solution

Here is a simple solution to get rid of this problem.Simply set the execution policy to "Unrestricted".

Execute the below command in PowerShell window :

Set-ExecutionPolicy -ExecutionPolicy Unrestricted

Now locate your powershell script path and try running the script.You should be able to execute it successfully.

Happy SharePointing !!!!
X

Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now