Errata

Windows PowerShell Cookbook

Errata for Windows PowerShell Cookbook

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
online
Example 9-3

In Example 9-3, the sample program "Get-Characteristics.ps1", there is a line where the offset for the PE signature is being read:

## The offset of the signature in the file is stored at location 0x3c.
$signatureOffset = $fileBytes[0x3c]

Instead of being a single byte, this value is a 4-byte integer, and so it needs to be read this way:

$signatureOffset = [BitConverter]::ToInt32($fileBytes, 0x3c)

(I'm not positive that the value is a signed integer, it may be unsigned, in which case the ToUInt32() method would need to be used.)

Chuck Heatherly  Oct 14, 2010 
Printed Page 223
Second sample command line

The parameter name -ParseExpression should be -Pattern to match the parameters defined in the Convert-TextObject example script from Recipe 5.14.

Anonymous  Jul 11, 2011 
Printed Page 461
Exaple 18-4

The example tests if the credential exists in memory, but then goes ahead and prompts for the credential regardless. This script is missing an else statement -- it should only prompt if it doesn't exist.

Charlie Russel (Microsoft MVP)  Mar 11, 2013