PowerTip: Open a script in PowerShell ISE


Summary: Automatically open a script in the Windows PowerShell ISE.

Hey, Scripting Guy! Question How can I automatically open a script in the Windows PowerShell ISE from within a script?

Hey, Scripting Guy! Answer Use the Windows PowerShell ISE automation model, and use the Add method for the Files collection
on the current PowerShell tab, for example:

$psISE.CurrentPowerShellTab.Files.Add("C:\fso\backup.ps1")

 

Comments (0)

Skip to main content