PowerShell script error – File not digitally signed : FIX

Leave a comment (0) Go to comments

Today I was working on building PowerShell script to establish SQL Server Database Mirroring. To start with PowerShell, I tried to execute my first built of PowerShell Script on SQLPS, I received the following error.PowerShell script error   File not digitally signed : FIX system signed set executionpolicy set scripts script save remote Powershell Security powershell policy NOT loaded file execution scripts disabled system powershell set policy set executionpolicy remote signed save script cannot loaded because not digitally file execution disabled digitally cannot because  File C:\Temp\Mirroring\Script\DBMirrroringSetup.ps1 cannot be loaded. The file C:\Temp\Mirroring\Script\DBMirrroringSetup.ps1 is not digitally signed. The script will not execute on the system. Please see “get-help about_signing” for more details..
At line:1 char:47+ C:\Temp\Mirroring\Script\DBMirrroringSetup.ps1 <<<<    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException     + FullyQualifiedErrorId : RuntimeException

You may also get Error “The execution of scripts is disabled on this system


As per the error message, the script is not trusted to be run on your system. This is because, my current security policy doesn’t allow to run any PowerShell Script, which is not Digitally signed.

FIX / Resolution

I have seen this issue in past where I get error “execution of scripts is disabled on this system”, to fix this, I modified security settings and asked PowerShell environment to run any PowerShell Script by setting ““ExecutionPolicy” as  Unrestricted, using the following command in PowerShell window “Set-ExecutionPolicy Unrestricted”

PowerShell script error   File not digitally signed : FIX system signed set executionpolicy set scripts script save remote Powershell Security powershell policy NOT loaded file execution scripts disabled system powershell set policy set executionpolicy remote signed save script cannot loaded because not digitally file execution disabled digitally cannot because

Note : Make sure, the command prompt / PowerShell window is opened with elevated privileges, I mean to say, run as Administrator Mode.

After that, when I ran my PowerShell script, that worked without any issues.

EOF - PowerShell script error – File not digitally signed : FIX, SQL Server 2012 , 2008 R2 , 2008 , 2005 , 2000

Leave a Reply

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


*


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.