Created
October 19, 2017 13:29
-
-
Save AlesRuzickaEu/c906ef4e4af8a843afc303882cdf1ab9 to your computer and use it in GitHub Desktop.
Sign Powershell 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
function Sign-File( | |
[Parameter(Mandatory=$True,Position=0,ValueFromPipeline)] | |
[string[]] | |
$FilePath) { | |
Set-AuthenticodeSignature $FilePath $(Get-ChildItem -Path cert:\CurrentUser\my -CodeSigningCert) | |
} | |
function Sign-Directory( | |
[Parameter(Position=0)] | |
[string[]] | |
$Directory = '.') { | |
$cert = Get-ChildItem -Path cert:\CurrentUser\my -CodeSigningCert | |
Get-Item *.ps1 | Set-AuthenticodeSignature -Certificate $cert | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment