Freigeben über


Update an ISE Snippet

Snippets. Little script blocks that save time when crafting a script with the Integrated Scripting Environment (ISE).

Now, if, like me, you've used the New-IseSnippet cmdlet to create your own snippets, then, also like me, you may need to update one of those snippets from time to time.

How to update?

Well, first you'll need to get the snippet in question.

Get-IseSnippet | Where-Object Name -like if*

 

 

Notice that it shows the parent 'Directory'. Let's use Get-Member to look at the properties associated with the returned FileInfo object.

Now, let's use the FullName property to look at the snippet and then open it with Notepad for some simple editing.

 

Focus on the script node and edit your snippet. Save and close. Job done.