Last active
March 31, 2024 18:25
-
-
Save AfroThundr3007730/5f0e8276a1900b252efcf10fd1773929 to your computer and use it in GitHub Desktop.
Wrapper to Set-AuthenticodeSignature
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 Set-ScriptSignature { | |
<# .SYNOPSIS | |
Wrapper function to sign and timestamp a script file #> | |
[Alias('SignScript')] | |
Param( | |
# The script file to sign | |
[Parameter(Mandatory)] | |
[String]$ScriptFile | |
) | |
Set-AuthenticodeSignature -FilePath $ScriptFile -Certificate ( | |
Get-ChildItem -Path Cert:\CurrentUser\My -CodeSigningCert | |
)[0] -TimestampServer 'http://timestamp.digicert.com' #DevSkim: ignore DS137138 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated version available in my HelperFunctions module.