Execute a Powershell script on Windows Vista

script.ps1 is not digitally signed. The script will not execute  on the system. Please see “get-help about_signing” for more details.

To solve the problem, you can just change the Execution policy to “RemoteSigned” with the folowing command (as Administrator):
Set-ExecutionPolicy RemoteSigned   -   Note that this option is not recomanded!

The more secure way is to digitaly sign the script.

  1. Navigate to the location of your code signing certificate (like “Set-Location cert:\CurrentUser\my\” for Personal certificates).
  2. Type Get-CilldItem to get a list of all certificates in thihs location and copy the Thumbprint of the right certificate.
  3. Set the ”$cert” with the certificate location:

$cert = Get-Childitem -Path cert:\CurrentUser\My\A4309AD8067D6AC70E36B578A890A1EFC3FB -CodeSigningCert

    4.    Now with the folowing command digitaly sign the file
            (ex.: Powershell profile)

Set-AuthenticodeSignature -FilePath C:\…\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 -cert $cert

Leave a Reply

You must be logged in to post a comment.