Page 1 of 1

Signing Scripts

Posted: Wed Nov 11, 2015 9:17 am
by mwgevans

I have signed a script using PowerShell Studio 2015 both manually using the button on the tools ribbon and by setting to sign on save. When I run the script I get the following.

ERROR: & : File C:\Users\Mark Evans\Documents\SAPIEN\Files\Hello World.ps1 cannot be loaded. The contents of file C:\Users\Mark Evans\Documents\SAPIEN\Files\Hello
ERROR: World.ps1 might have been changed by an unauthorized user or process, because the hash of the file does not match the hash stored in the digital signature.
ERROR: The script cannot run on the specified system. For more information, run Get-Help about_Signing..
line (1, 2): ERROR: At Line: 1 char: 2
ERROR: + &'C:\Users\Mark Evans\Documents\SAPIEN\Files\Hello World.ps1'
ERROR: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: + CategoryInfo : SecurityError: (:) [], PSSecurityException
ERROR: + FullyQualifiedErrorId : UnauthorizedAccess

My execution policy is set as follows.

PS C:\Users\Mark Evans\Documents\SAPIEN\Files> Get-ExecutionPolicy -list

Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser AllSigned
LocalMachine AllSigned


Re: Signing Scripts

Posted: Thu Nov 12, 2015 10:17 am
by davidc
What build of PowerShell Studio do you have installed?