Skip to content

Instantly share code, notes, and snippets.

@dsolodow
Created June 13, 2020 23:34
Show Gist options
  • Save dsolodow/6f3df88e3a76320c5c84142cf9a3a58d to your computer and use it in GitHub Desktop.
Save dsolodow/6f3df88e3a76320c5c84142cf9a3a58d to your computer and use it in GitHub Desktop.
PS script sign in VSCode
Register-EditorCommand -Name SignCurrentScript -DisplayName 'Sign Current Script' -ScriptBlock {
$cert = (Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert)[0]
$currentFile = $psEditor.GetEditorContext().CurrentFile.Path
Set-AuthenticodeSignature -Certificate $cert -FilePath $currentFile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment