PowerShell – The file is not digitally signed. You cannot run this script on the current system.

In this post, let’s learn about the Powershell error “The file <Filename> is not digitally signed. You cannot run this script on the current system.” and how to fix it on your Windows PC.

Powershell Error Message

The file <Filename> is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.

When you run a PowerShell script that has not been signed by a trusted publisher on your Windows PC, you may get the following security error:

The file <Filename> is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.

This is one of the security errors that occurs when the PowerShell’s execution policy is set to be Allsigned or Remotesigned.

How to fix this PowerShell Error?

You can fix this error by running the below command.

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

This will set the execution policy to bypass for the current PowerShell session. The parameter “Bypass” means the code will not be blocked from running and no warnings or messages will be returned.

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Are you looking at importing DscResource with Relative Paths when working in PowerShell? If so, let’s have a look at...
If you are new to PowerShell and wondering how to add comments with-in your Powershell code , here’s how you...
If you want to find the version of the PowerShell that is installed on the PC , you can use...