Skip to content

Instantly share code, notes, and snippets.

@micmaher
Last active April 20, 2016 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micmaher/14b4880060df690b8e3f to your computer and use it in GitHub Desktop.
Save micmaher/14b4880060df690b8e3f to your computer and use it in GitHub Desktop.
Sign Scripts
# Michael Maher
# 25/9/15
# Sign Script
# Usage: signScript.ps1 <path to script>
param (
$myScript = $(throw "Please specify a path to the script
For Example: .\signScript c:\scripts\archiveSecLog.ps1")
)
If(!(Test-path $myScript)) {Write-Host "Path not found:" $myScript
Exit}
$cert=(dir cert:currentuser\my\ -CodeSigningCert)
Set-AuthenticodeSignature $myScript $cert -TimestampServer http://timestamp.verisign.com/scripts/timstamp.dll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment