PowerShell with ISE, shaken not stirred

Many people think of Windows PowerShell as a command line interface (CLI) rather than a graphical user interface (GUI). Shouldn’t it be called a textual user interface (TUI)?

Two peas in a pod, the Console Host (conhost.exe) and PowerShell (powershell.exe) provide a classic cmd.exe style window  for typical the shell experience. Actually, in Windows Server 2008 R2 (and Windows 7), not only does conhost.exe host powershell.exe, but also cmd.exe. Therefore, the window environment that the Windows Command Prompt and Windows PowerShell version 2.0 each run in is the same in these latest versions of Windows.

But there is another way – bring on the ISE! On Windows Server 2008 R2, PowerShell can be run in another hosting environment, namely the Windows PowerShell Integrated Scripting Environment (ISE). How?

Right-click the PowerShell icon in the taskbar, and then chose Windows PowerShell ISE from the menu. Alternately, you could choose Windows PowerShell ISE from the submenu on most PowerShell items in the Start Menu or Administrative Tools. For yet another approach, in either the Windows PowerShell console, Cmd.exe, or in the Start/Search or Start/Run… box, type, powershell_ise.exe.

Once you are in PowerShell ISE, you should have a menu bar with File, Edit, View, Debug, and Help menus; a toolbar offers an array of editing and debugging tools; then there are three panes of the window beneath those, and a status bar at the bottom. The three main panes of the window are (a) a tabbed editor called the Script pane, (b) the command output pane simply referred to as the Output pane, and (c) a prompt for the current command – this is named the Command pane. Script, Output, Command. Let’s look at each of these.

First, there’s no reason to not take PowerShell ISE fullscreen, so if you’re following along on Windows 7 or Windows Server 2008 R2 in PowerShell v2.0, launch the ISE and go fullscreen. Now. Why be cramped into a small little window with three panes? Also, cozy on up to your <Control> key, because it can really help with navigation.

For serious scripting, or actually even for casual scripting, you can quickly tire of Notepad. Having a tabbed editor integrated into PowerShell ISE is nice. Even better – you can put it where you want it. Type <Ctrl>+1 to show the Script pane on the top (default), <Ctrl>+2 to show it on the right, or <Ctrl>+3 to maximize it so it takes up the whole PowerShell ISE window. When you’re just focused in interactive commands you can hide the script pane simply by typing <Ctrl>+R, which can be used again to bring the script pane back again. If your cursor is in one of the other panes, you can quickly navigate to the script pane by typing <Ctrl>+I (think “input”). Note that you can edit data files (XML, CSV, etc.), text, PowerShell scripts (.ps1), batch files (.bat), or whatever else you want in the the script pane.

Are you interested in learning more about the PowerShell ISE? Tune in to this blog soon for more on the other components. In the meantime, maybe you’ll throw out Notepad and start doing all your file edits in the PowerShell ISE script pane?

-Brad

Related Courses

Configuring, Managing, and Maintaining Server 2008 (M6419)

Automating Windows Server 2008 Administration with Windows Powershell (M6434)

Microsoft Exchange Server 2007 (M5047, M5049, M5051)

Implementing and Administering Windows 7 in the Enterprise

In this article

Join the Conversation