Problem: Unable to sign Powershell Script

I tried to sign an old Powershell script with this command:

Set-AuthenticodeSignature 'C:\MyScript.ps1' -cert (get-childitem cert:\currentuser\my\ -codesigningcert)

..but the output was: Unknown Error

This was not the only one that I’ve signed but it’s the only one that I was not able to sign!

After some investigation I discover the problem: the script encoding was “Unicode big endian”. Changed it to UTF-8 I was able to sign it (you can use notepad to change encoding).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s