July 2017
Beginner
222 pages
5h 2m
English
With access to a signing certificate, we can finally sign scripts with the Set-AuthenticodeSignature command:
$signingCert = Get-ChildItem -Path Cert:\CurrentUser\My -CodeSigninigCert Set-AuthenticodeSignature -Certificate $signingCert -FilePath C:tempHelloWorld.ps1SignerCertificate Status Path ----------------- ------ ---- 62092339EDBA1C50E86B4C6BBA960C98FF02820D Valid HelloWorld.ps1
A signature section will be appended to the script. If you make any changes, you will have to sign the script again before the script can run again (as long as the applicable execution policy requires certificates to be signed):

Read now
Unlock full access