Showing posts with label ISE Object Model. Show all posts
Showing posts with label ISE Object Model. Show all posts

Monday, October 22, 2018

How do you display Commands pane in Windows PowerShell?

You often want to look at all commands available shown in the commands pane.
By default it may not be shown when you launch PowerShell and perhaps this is what you see.


PS_CommandsPane_0


You can display the command pane using the View menu as shown.


PS_CommandsPane_1


Click Show Command Add-on. Now the command pane is added as shown.


PS_CommandsPane_2


You can also use the Object Model code to display the Command pane as shown.


PS_CommandsPane_3

Sunday, October 21, 2018

Can you modify the Windows PowerShell ISE User Interface?

The short answer is 'Yes'.

Windows PowerShell ISE has a Scripting Object Mdel which is hierarchical. The root object is: $psISE object which is an instance of Microsoft.PowerSehll.Host.ISE.ObjectModelRoot class.

Under the 'root' there are many other objects such as; CurrentFile, CurrentPowerShellTab etc.


Here are some $psISE properties:


ISE_0


ISE_1


ISE_2


ISE_3

From the 'root. object I can create a new tab in the Windows PowerShell ISE with a name to display it as shown.

You can create a new tab 'Test' using this code. A new tab 'Test' is added to the UI as shown.:


ISE_04