Skip to content

Instantly share code, notes, and snippets.

@jespernohr
Last active September 24, 2015 13:29
Show Gist options
  • Save jespernohr/b46fef2c92ddd003721a to your computer and use it in GitHub Desktop.
Save jespernohr/b46fef2c92ddd003721a to your computer and use it in GitHub Desktop.
sign powershell scripts using a code signing ssl certificate.
# use commands to sign powershell scripts using a code signing ssl certificate.
# prerequsits:
# 1. Self-signed, 3rd party or Active Directory Certificate Services codesigning certificate installed.
# 2. client computers or client servers should trust the publisher/auther (user) used signed the script.
# sets Windows execution policy to secure.
Set-ExecutionPolicy AllSigned
# sign the script with the "Code Signing" certificate in Certificate - Current User - Personal - Certificates store.
Set-AuthenticodeSignature C:\Set-Static-IP.ps1 @(Get-ChildItem cert:\CurrentUser\My -CodeSigningCert)[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment