Created
June 13, 2020 23:34
-
-
Save dsolodow/6f3df88e3a76320c5c84142cf9a3a58d to your computer and use it in GitHub Desktop.
PS script sign in VSCode
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
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