Open Scripts in a new tab in the PowerShell ISE using PSEdit

While at TechEd last week, PSEdit was used in one of the PowerShell sessions that I sat through. Afterwards a couple of friends asked me if I had ever heard of it and said they hadn’t so I thought I would write a blog article about it to help spread the word.

PSEdit is a function that only exists in the PowerShell ISE. Type in PSEdit followed by the name of a PowerShell script and that script will be opened in a new tab in the ISE:

051814-1

Try the same thing in the PowerShell console and you’ll end up with an error message:

051814-2

Since psEdit is a function and not a compiled cmdlet, you can take a look under the covers to see what it does behind the scenes:

051814-3

There’s very little help for psEdit and this is even after running Update-Help from within the PowerShell ISE:

051814-4

Even though the filenames parameter doesn’t show it accepting an array [], based on the code and a little testing, a common separated list can be used to open multiple scripts:

051814-5

I’ve actually written a previous blog article to locate and open scripts in the PowerShell ISE that uses the same behind the scenes code as psEdit that you may also find interesting.

µ

About Mike Robbins

PowerShell Enthusiast | IT Pro | Winner of the Advanced Category in the 2013 PowerShell Scripting Games | Author of Chapter 6 in the PowerShell Deep Dives Book.
This entry was posted in PowerShell and tagged . Bookmark the permalink.

One Response to Open Scripts in a new tab in the PowerShell ISE using PSEdit

  1. Graeme says:

    After playing with this, you can also open anything that may have the string ‘DHCP’ in the title for example, if your version control is -v1 -v2 etc. Typing on my phone, but I think you get the point.

    You can just the wildcard of * if I remember correctly.

    You do have to be in the same directory of course.

Leave a Reply