Function to invoke PowerShell ISE from shell

Another little function to add to your PowerShell profile.

If you’re in the PowerShell Integrated Scripting Environment you can use the command

psedit <filename>

to open the file in the ISE editor – and it doesn’t just have to be a .ps1 file, it’ll open anything.

But if you have a regular PowerShell prompt open, psedit doesn’t work. Until now!

function psedit ($Filename){
    & "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell_ise.exe" $Filename

It’ll also work if you just type psedit with no filename, and will open a new tab in the editor.

This entry was posted in PowerShell and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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