You can quickly open file(s) in a new tab in Powershell ISE with psEdit. PowerShell ISE has this useful psEdit command that allows you to open and edit a PowerShell Script. If you type psEdit in your PowerShell console, you will get the following error message:
psEdit only works in the ISE because it is an editing application. Powershell CLI/Console is not designed for editing:
psedit : The term ‘psedit’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ psedit
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (psedit:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
The psEdit function is available only in the PowerShell ISE. Let’s confirm by running the following command in your ISE:
PS > gcm psedit | fl * Name : psEdit CommandType : Function Definition : param([Parameter(Mandatory=$true)]$filenames) foreach ($filename in $filenames) { dir $filename | where {!$_.PSIsContainer} | %{ $psISE.CurrentPowerShellTab.Files.Add($_.FullName) > $null } }
psEdit is a function and not a compiled cmdlet.
With psEdit, you can open multiples files with only one command:
PS > psedit -filenames C:\Temp\file1.csv, C:\Temp\file2.csv
Thanks for reading! You can follow me on Twitter @PrigentNico