Create a New PowerShell ISE snippet


Since PowerShell 3, we have an incredibly good Integrated Scripting Environment shipped with for free.I kind of fan of the “Ctrl+J” shortcut, or “Edit -> Start Snippets”. You have instant access to a lot of code structure of PowerShell scriptword, of functions templates, as well as DSC templates¬†:


If this is not enough for you, you can create your own snippets code, just like that :

$snippet = @{
    Title = "Help";
    Description = "Standard script Help";
    Text = @"
New-IseSnippet @snippet

You can write whatever you want in the herestring, you can even use variables. You may want to use the “-Force” on New-IseSnippet if you need to modify an existing one.

Once you’re done, “Ctrl+J” again :


All your custom snippets are stored next to your PowerShell profile :



0 thoughts on “Create a New PowerShell ISE snippet

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.