December 16th, 2014

PowerTip: Programmatically Open Script in PowerShell ISE

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to open a script in the Windows PowerShell ISE.

Hey, Scripting Guy! Question How can I use Windows PowerShell to run a script that will open another script in a new tab
           in the Windows PowerShell ISE?

Hey, Scripting Guy! Answer Use the CurrentPowerShellTab Files Add method from the $psISE object, for example:

$psISE.CurrentPowerShellTab.Files.Add("C:\fso\Get-Battery.ps1")

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.