New features in Windows PowerShell ISE for Windows 2012

Many new features and improvements have been added to Windows PowerShell ISE for Windows Server 2012.

Intellisense. Intellisense, an auto-completion assistance feature that is similar to that found in Visual Studio, is now part of Windows PowerShell ISE. Intellisense displays clickable menus of matching cmdlets, parameters, parameter values, files, or folders as you type.

Add-on tools. Windows PowerShell ISE now supports add-on tools, which are Windows Presentation Foundation (WPF) controls that are added by using the object model. Add-on tools can be displayed in the console by using either a vertical or a horizontal pane. Multiple add-on tools in a pane are displayed as a tabbed control. A maximum of 20 user-defined add-on tools are allowed. You can also add or remove add-on tools that are produced by third parties. For more information about how to import or remove add-on tools, see Windows PowerShell ISE operations content on the web.

Restart Manager and Auto-save. Windows PowerShell ISE now automatically saves your open scripts every two minutes. To change the automatic saving interval, run the following in the console pane: $psise.Options.AutoSaveMinuteInterval. If Windows PowerShell ISE stops working or if the operating system is restarted, when you restart Windows PowerShell ISE it recovers scripts that were open in the last session, even if the scripts were not saved.

Console pane. The separate command and output panes that were available in the first release of Windows PowerShell ISE have been combined into a single console pane. The console pane is similar in function and appearance to a typical Windows PowerShell console, but includes the following enhancements. Most of these are described in this topic.

Syntax coloring for input text (not output text)

Intellisense

Brace matching

Error indication

Full Unicode support

F1 context-sensitive Help

Ctrl+F1 context-sensitive Show-Command

Complex script and right-to-left support

Font support

Zoom

Line-select and block-select modes

Preservation of typed content at the command line when you press the Up arrow to view history in the console

Command-line switches. If you start Windows PowerShell ISE from the command line, (Powershell_ise.exe) you can now add the following new command-line switches.

-NoProfile: Starts Windows PowerShell ISE without running $profile.

-Help: Displays a Help window.

-mta: Starts Windows PowerShell ISE in multithreaded apartment mode. (The default is STA.)

Other Windows PowerShell ISE editing features adapted from Visual Studio:

Brace matching. Windows PowerShell ISE now includes brace matching and highlighting (for example, using the Go to Match command locates the closing brace, if you have an opening brace selected).

Outline view. The script pane now supports outlining, which allows collapsing or expanding sections of code by clicking plus or minus signs in the left margin. You can use either braces or #region and#endregion tags to mark the beginning or end of a collapsible section.

Parse error display. Parse errors are now indicated by using red underlines. When you hover over an indicated error, Tooltip text displays the problem that was found in the code.

Zoom. The zoom percentage of the console’s content can be set by using the zoom slider (in the lower right corner of the Windows PowerShell ISE window), or by entering the command$psise.options.Zoom in the console pane.

Rich text copy and paste. Now, copying to the clipboard in Windows PowerShell ISE preserves the font, size, and color information of the original selection.

Block selection. You can select a block of text by holding down the ALT key while selecting text in the script pane with your mouse, or by pressing Alt+Shift+Arrow.

New Help viewer window. If you press F1 when your caret is in a cmdlet, or you have part of a cmdlet highlighted, the new Help viewer opens context-sensitive Help about the highlighted cmdlet. To display Windows PowerShell About Help, type operators in the console pane, and then press F1. Before you use this feature, download the most current version of Windows PowerShell Help topics from the Microsoft website. The simplest method of doing this is to run the Update-Help cmdlet in the console pane.

Show-Command. Show-Command allows you to compose or run a cmdlet or function by filling out a GUI-based form. The form lets users work with Windows PowerShell in the graphical environment they are comfortable with. Show-Command also enables advanced scripters to create a quick Windows PowerShell-based GUI.

Advertisements