Windows PowerShell for Developers

Errata for Windows PowerShell for Developers

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
PDF Page 9
4th paragraph

The last sentence in the 4th paragraph states: "Here, we just did
some observing." It's not clear what was observed and how. There was a Get-Content call used, but no Get-Member call was used.

Note from the Author or Editor:
Thanks for catching that. This sentence can be removed.

"Here, we just did some observing."

Thanks again

Anonymous  May 23, 2013 
ePub Page 15
1st Paragraph

the phrase "results (or errors)" should be altered to results (and/or errors) A single cmdlet can output messages, warnings, debug info, verbose info, and pipeline output..

While it would be counterproductive to enumerate all these things, it would be more accurate to say results and/or errors without confusing the reader.

Justin Dearing  Oct 17, 2012 
Printed Page 17
paragraph "Semicolons", first sentence

Semicolons are only optional if each statement is on its own line. The sample in the book won't work, it trhows a compilation error from line 2. There the semicolon is necessary (between " World" and the variable $s.

Reto Fricker  Sep 30, 2012 
Printed Page 19
"Try/Catch/Finally" code sample

The Try/Catch/FInally sample is given as follows, with the

try {
"Hello World"
} catch {
"Error caught: $($error[0])"
} finally {
"Finally, Hello World"

The author claims that the result will be that the exception will be caught and the finally block will run. However, that isn't the case here, as 1/0 is caught before the script is even interpreted, since 1/0 can be fully evaluated by the interpreter. This can be shown by inserting a string or a Write-Host before the try - it will not be shown.

The author's desired result can be achieved by ensuring that the exception is caught at runtime. For example, 1/0 can be replaced by $a=0; 1/$a.

Nick Walker  Aug 23, 2012 
ePub Page 19
1st Paragraph

You claim ISE is available as soon as you install powershell on all versions of Windows, and available immediatly on WIndows 7/8.

On Server OSes, ISE is a distinct install from PowerShell, and not clicked by default when you click on PowerShell.


Justin Dearing  Oct 17, 2012 
Printed Page 19
Body of text

I agree with the previous errata commentator that substituting an $a=1 for the literal "1" fixes the issue and the code works as described.

ChazUbell  Oct 05, 2015 
PDF Page 22
Scriptblocks section $sampleData

The following $sampleData starts with "," followed by (3,4,12)
$sampleData = @(
The first comma throws error. Instead it should be
$sampleData = @(

Note from the Author or Editor:
Thanks for the submission, I'm running v3 and the book version runs as expected on my box.

Are you running PowerShell v2?

Udooz  Jul 28, 2012 
Printed Page 22
Example of "Scriptblocks, Dynamic Languages, and Design Patterns"

The 3rd value of both array in $sampleData is not used. This 3rd value could be used to test the result for the strategies.


foreach($dataset in $sampleData) {
foreach($strategy in $strategies) {
"computed: {0,4} expected: {1,4} => {2}" -f (& $strategy $dataset[0] $dataset[1]), $dataset[2], ($result -eq $dataset[2])

Reto Fricker  Sep 30, 2012 
Other Digital Version 564 of 4016
Scriptblocks, Dynamic Languages, and Design Patterns

There should not be a comma before the first item in the $sampleData array.

$ sampleData = @( ,( 3,4,12) ,( 5,-5,-25) )

It fails on PowerShell:
5 0 10586 117
5 1 14393 187
6 0 0 alpha-10

From a Kindle version.

Liturgist  Sep 25, 2016