Windows PowerShell™ Scripting Guide

Errata for Windows PowerShell™ Scripting Guide




The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update



Version Location Description Submitted By Date Submitted Date Corrected
Printed
Page 89-94

.Value missing from code samples On pages 89-94, several code samples do not include .Value as needed. In the first code sample on page 89, change: $objRecordSet.Fields.item("TimeStamp") = Get-Date $objRecordSet.Fields.item("strComputer") = $strComputer $objRecordSet.Fields.item("strDomain") = $strDomain $objRecordSet.Fields.item("strService") = $strServiceName $objRecordSet.Fields.item("strStatus") = $strStatusTo: $objRecordSet.Fields.item("TimeStamp").Value = Get-Date $objRecordSet.Fields.item("strComputer").Value = $strComputer $objRecordSet.Fields.item("strDomain").Value = $strDomain $objRecordSet.Fields.item("strService").Value = $strServiceName $objRecordSet.Fields.item("strStatus").Value = $strStatusIn the "WriteRunningServicesToAccess.ps1" code sample on page 90, change: $objRecordSet.Fields.item("TimeStamp") = Get-Date $objRecordSet.Fields.item("strComputer") = $strComputer $objRecordSet.Fields.item("strDomain") = $strDomain $objRecordSet.Fields.item("strService") = $strServiceName $objRecordSet.Fields.item("strStatus") = $strStatusTo: $objRecordSet.Fields.item("TimeStamp").Value = Get-Date $objRecordSet.Fields.item("strComputer").Value = $strComputer $objRecordSet.Fields.item("strDomain").Value = $strDomain $objRecordSet.Fields.item("strService").Value = $strServiceName $objRecordSet.Fields.item("strStatus").Value = $strStatusIn the first code sample on page 92, change: $objRecordSet.Fields.item("TimeStamp") = Get-Date $objRecordSet.Fields.item("strComputer") = $strComputer $objRecordSet.Fields.item("strDomain") = $strDomain $objRecordSet.Fields.item("strService") = $strServiceName $objRecordSet.Fields.item("strStatus") = $strStatusTo: $objRecordSet.Fields.item("TimeStamp").Value = Get-Date $objRecordSet.Fields.item("strComputer").Value = $strComputer $objRecordSet.Fields.item("strDomain").Value = $strDomain $objRecordSet.Fields.item("strService").Value = $strServiceName $objRecordSet.Fields.item("strStatus").Value = $strStatusIn the last code sample on page 93, change: $objRecordSet.Fields.item("strStartMode") = $strStartMode $objRecordSet.Fields.item("blnAcceptPause") = $blnAcceptPause $objRecordSet.Fields.item("blnAcceptStop") = $blnAcceptStopTo: $objRecordSet.Fields.item("strStartMode").Value = $strStartMode $objRecordSet.Fields.item("blnAcceptPause").Value = $blnAcceptPause $objRecordSet.Fields.item("blnAcceptStop").Value = $blnAcceptStopIn the "WriteServiceConfigToAccess.ps1" code sample on page 94, change: $objRecordSet.Fields.item("TimeStamp") = Get-Date $objRecordSet.Fields.item("strComputer") = $strComputer $objRecordSet.Fields.item("strDomain") = $strDomain $objRecordSet.Fields.item("strService") = $strServiceName $objRecordSet.Fields.item("strStartName") = $strStartName $objRecordSet.Fields.item("strStartMode") = $strStartMode $objRecordSet.Fields.item("blnAcceptPause") = $blnAcceptPause $objRecordSet.Fields.item("blnAcceptStop") = $blnAcceptStopTo: $objRecordSet.Fields.item("TimeStamp").Value = Get-Date $objRecordSet.Fields.item("strComputer").Value = $strComputer $objRecordSet.Fields.item("strDomain").Value = $strDomain $objRecordSet.Fields.item("strService").Value = $strServiceName $objRecordSet.Fields.item("strStartName").Value = $strStartName $objRecordSet.Fields.item("strStartMode").Value = $strStartMode $objRecordSet.Fields.item("blnAcceptPause").Value = $blnAcceptPause $objRecordSet.Fields.item("blnAcceptStop").Value = $blnAcceptStop

Microsoft Press  May 06, 2010 
Printed
Page 126

less should be greater On page 126, the third sentence after the bulleted list refers to a type code less than 10, rather than greater than 10. Change: "Use a filter to obtain only shares with a type code less than 10." To: "Use a filter to obtain only shares with a type code greater than 10."

Microsoft Press  Jul 13, 2010 
Printed
Page 210

" " should be "@ On page 210, the third sentence contains incorrect information regarding closing a here-string. Change: "A here-string is defined by using the following tags: @" to open the here-string and " " to close the here-string." To: "A here-string is defined by using the following tags: @" to open the here-string and "@ to close the here-string."

Microsoft Press  May 06, 2010 
Printed
Page 212

GetNetAdapterStatus.ps1 full script incomplete On page 212, the second hald of the full csript for GetNetAdapterStatus.ps1 is missing a foreach loop. Add the following code to the end of the code sample on page 212: foreach($net in $objWMI) { Write-Host "$($net.name)" funstatus($net.netconnectionstatus) } Microsoft Press is committed to providing informative and accurate books. All comments and corrections listed above are ready for inclusion in future printings of this book. If you have a later printing of this book, it may already contain most or all of the above corrections.

Microsoft Press  Jul 13, 2010