Skip to content

Instantly share code, notes, and snippets.

@AfroThundr3007730
Last active March 31, 2024 18:25
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 AfroThundr3007730/5f0e8276a1900b252efcf10fd1773929 to your computer and use it in GitHub Desktop.
Save AfroThundr3007730/5f0e8276a1900b252efcf10fd1773929 to your computer and use it in GitHub Desktop.
Wrapper to Set-AuthenticodeSignature
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
}
@AfroThundr3007730
Copy link
Author

Updated version available in my HelperFunctions module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment