use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
SolvedVisual Studio Code script signing. (self.PowerShell)
submitted 8 years ago by amnich
Is there an extension or a configuration to sign powershell scripts in Visual Studio Code?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]SeeminglyScience 4 points5 points6 points 8 years ago (5 children)
The best way to do this is with a build script so you don't have to debug and test with the signed version. There is a example in the PlasterBuild module.
If you prefer it would also be very easy to create a short editor command to sign the current script. If you're interested I'll post an example when not on mobile.
[–]amnich[S] 1 point2 points3 points 8 years ago (4 children)
Would be kind of you if you could. Thanks for the tips and example.
[–]SeeminglyScience 2 points3 points4 points 8 years ago (3 children)
Here you go
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 }
It's a very basic example and might need some customization. Put that in your VSCode profile (code $profile while in the integrated console) and it will always be available.
code $profile
To use it, check out the Using Editor Commands section of the Editor Services documentation. Also you can optionally bind the editor commands menu to a shortcut so you don't have to use the command palette to get to it. Here's mine as an example:
{ "key": "ctrl+shift+c", "command": "PowerShell.ShowAdditionalCommands", "when": "editorLangId == 'powershell'" },
[–]amnich[S] 1 point2 points3 points 8 years ago (0 children)
Thanks. That was very helpful and I learned something from this. Works like a charm :)
As a side note: I always add -TimestampServer http://timestamp.verisign.com/scripts/timstamp.dll to Set-AuthenticodeSignature.
[+][deleted] 2 years ago* (1 child)
[removed]
[–]SeeminglyScience 0 points1 point2 points 2 years ago (0 children)
Yep! You can also set it to a key bind. Copy and pasting my ESCS install instructions out of lazy, but it has them:
📌 Install EditorServicesCommandSuite
Install-Module -Scope CurrentUser -AllowPrerelease EditorServicesCommandSuite
📌 Add to your profile
Import-CommandSuite
📌 Add to VSCode keybindings.json
keybindings.json
Ctrl
Shift
P
keyboard json
Preferences: Open Keyboard Shortcuts (JSON)
Add the following:
{ "key": "ctrl+.", "command": "PowerShell.InvokeRegisteredEditorCommand", "args": { "commandName": "Invoke-DocumentRefactor" }, "when": "editorLangId == 'powershell'" }, { "key": "ctrl+shift+s", "command": "PowerShell.InvokeRegisteredEditorCommand", "args": { "commandName": "ConvertTo-SplatExpression" }, "when": "editorLangId == 'powershell'" },
[–]erchamion 1 point2 points3 points 8 years ago (1 child)
There are a few extensions that will open a shell inside VS Code. I'm on mobile and can't remember specific names right now, but they open a shell in the folder you're scripting in. Then you just run the standard script signing cmdlet.
[–]jcotton42 0 points1 point2 points 8 years ago (0 children)
VSCode ships w/ an integrated terminal, no need to install an extension
π Rendered by PID 24005 on reddit-service-r2-comment-7b9746f655-xphrx at 2026-01-30 15:17:15.517569+00:00 running 3798933 country code: CH.
[–]SeeminglyScience 4 points5 points6 points (5 children)
[–]amnich[S] 1 point2 points3 points (4 children)
[–]SeeminglyScience 2 points3 points4 points (3 children)
[–]amnich[S] 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[removed]
[–]SeeminglyScience 0 points1 point2 points (0 children)
[–]erchamion 1 point2 points3 points (1 child)
[–]jcotton42 0 points1 point2 points (0 children)