Last active
April 20, 2016 12:57
-
-
Save micmaher/14b4880060df690b8e3f to your computer and use it in GitHub Desktop.
Sign Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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