Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Sign Powershell scripts

$
0
0

Hi,

i try to sign a powershell script, to run it with ExecutionMode "AllSigned". I have a Commercial code-signing certificate available, which is used by several .NET Developer in my Company.

Now i have done the following steps to sign a Powershell file with the certificate:

$cert = Get-PfxCertificate -FilePath "$($PSScriptRoot)\mycert.pfx"

$result = Set-AuthenticodeSignature -Certificate $cert -FilePath "$TargetDir\$File"

When i ran a script that was signed on this way, i got the message "File XYZ is published by "CN=ABC, ... ,C=DE" and is not trusted on your System".

This is reporducable on every Windows 10 System. The certificate is valid and comes from VeriSign-Symantec and a test with

"Test-Certificate $cert"

results true. What can i do to sign the files with a commercial certificate, so that Powershell scripts can run without any question on a Windows 10 System

Thanks

Dave



Viewing all articles
Browse latest Browse all 21975

Trending Articles