Windows PowerShell Cookbook by Holmes Lee

Windows PowerShell Cookbook by Holmes Lee

Author:Holmes, Lee [Holmes, Lee]
Language: eng
Format: mobi, epub, pdf
Tags: COMPUTERS / Programming / Microsoft Programming
Published: 0101-01-01T00:00:00+00:00


Figure 19-1. Windows PowerShell

Integrated Scripting Environment

Scripting pane

The scripting pane is the top pane

of the ISE, and it is geared

toward multiline script editing

and creation. It offers line

numbering and syntax

highlighting, and it supports a

great debugging experience.

One unique aspect of the

scripting pane is that it supports

selective execution: the ability to

run just what you’ve highlighted

rather than the entire script

you’re working on. This makes

script authoring a breeze. As you

start to write your script, you can

interactively experiment with

commands until you get them

right. Once they work as

expected, you can keep them,

move on, and then continue to

build your script one piece at a

time. As you’ve come to expect

from PowerShell’s console shell,

script editing in the scripting

pane supports tab completion of

commands, parameters, paths,

and more.

Console pane

The console pane, which sits in

the bottom of the application, is

where you’ll spend most of your

interactive sessions in the ISE.

Like the command prompt in the

PowerShell console, the console

pane supports tab completion.

Unlike the command pane in the

console window, it supports

standard Windows hotkeys, text

selection, syntax highlighting,

powerful IntelliSense, and more.

If you find your command

growing too long, you can press

Shift-Enter to enable multiline

editing for the current command.

If you want the ISE to look like the

regular PowerShell console (yet

support easy resizing and intuitive

hotkeys), simply select Show Script

Pane Maximized from the Tools

menu. You can then select Go to

Console and Go to Script Pane to

toggle between the fully immersive

console and script editing modes.

In addition to these features, the

PowerShell ISE offers extensive

customization, scripting, and

remoting support.

Debug a Script

Problem

You want to use PowerShell’s

debugging commands through an

interface more friendly than its *-

PsBreakpoint cmdlets.

Solution

Use the Debug menu in the ISE to

add and remove breakpoints and

manage debugging behavior when

PowerShell reaches a breakpoint.

Discussion

The PowerShell ISE gives you a

rich set of interactive graphical

debugging commands to help you

diagnose errors in your scripts. It

exposes these through the Debug

menu, and it behaves like many

other graphical debugging

environments you may have

experience with. Figure 19-2 shows

the debugging option available in

the ISE.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.