Skip to content

Instantly share code, notes, and snippets.

@seanosullivanuk
Created October 19, 2018 14:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save seanosullivanuk/ab49bac60c7503a4a62b80488e3b4502 to your computer and use it in GitHub Desktop.
Sign PowerShell scripts (Windows)

First, check the code signing certificate(s) are present in the Personal Store:

gci cert:\CurrentUser\My -codesigning

To sign, run the following code block:

$acert =(dir Cert:\CurrentUser\My -CodeSigningCert)[0]
Set-AuthenticodeSignature .\FileName.ps1 -Certificate $acert -TimestampServer http://timestamp.comodoca.com/authenticode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment