Objects are associated with the form and function of Windows PowerShell Integrated Scripting Environment (ISE). The object model reference provides details about the member properties and methods that these objects expose. Examples are provided to show how you can use scripts to directly access these methods and properties. The scripting object model makes the following range of tasks easier.
Customizing the appearance of the ISE
You can use the object model to modify the application settings and options. For example, you can modify them as follows:
- You can change the color of errors, warnings,
verbose outputs, and debug outputs.
- You can get or set the background colors for
the Command pane, the Output pane, and the Script pane.
- You can set the foreground color for the
- You can set the font name and font size for
Windows PowerShell ISE.
- You can configure warnings. This includes
warnings that are issued when a file is opened in multiple
PowerShell tabs or when a script in the file is run before the file
has been saved.
- You can switch between a view where the
Script Pane and the Output Pane are side-by-side and a view where
the Script Pane is on top of the Output Pane. You can dock the
Command Pane at the bottom or the top of the Output Pane.
Enhancing the functionality of the ISE
You can use the object model to enhance the functionality of Windows PowerShell ISE. For example, you can:
- Make additions and modifications to the
instance of the Windows PowerShell ISE itself. For example, you can
change the menus by adding new menu items and by mapping the new
menu items to scripts.
- Create scripts that perform some of the tasks
that you can perform by using the menu commands and buttons in
Windows PowerShell ISE. For example, you can add, remove, or select
a PowerShell tab.
- Complement tasks that can be performed by
using menu commands and buttons. For example, you can rename a
- Manipulate text buffers for the Command pane,
the Output pane, and the Script pane that are associated with a
file. For example, you can:
- Get or set all text.
- Get or set a text selection.
- Run a script or run a selected portion of a
- Scroll a line into view.
- Insert text at a caret position.
- Select a block of text.
- Get the last line number.
- Get or set all text.
- Perform file operations. For example, you
- Open a file, save a file, or save a file with
a different name.
- Determine whether a file has been changed
since it was last saved.
- Get the file name.
- Select a file.
- Open a file, save a file, or save a file with a different name.
You can use the scripting object model to create keyboard shortcuts for frequent operations.