Susan Harkins (407) [Avatar] Offline
#1
Please post errors in the published version of Learn Windows PowerShell in a Month of Lunches, Third Edition here. We'll publish a comprehensive list for everyone's convenience. Thank you!

Susan Harkins
Errata Editor
Manning Publications
462263 (1) [Avatar] Offline
#2
Error in Chapter 9: Questions & Lab answers for 4 and 5:

  • Lab Answer 4 is the answer to Lab Question 5.

  • As a result of the above, Lab Question 4 doesn't have an answer in the Lab Answers section. I think it's supposed to be:

  • Get-ADComputer -filter * | 
    -> Select-Object @{n='computername';e={$_.name}} | Get-Process

  • Lab Answer 5 isn't an answer to any of the questions (it's a copy of the command line listed in question 6).
  • 215812 (2) [Avatar] Offline
    #3
    the command in section 4.5.2 that ends with .computername.aliases generates an error.
    464781 (2) [Avatar] Offline
    #4
    Chp 3 Page 29


    "It’s always legal to specify parameter names, and when you do so, the order in which
    you type them isn’t important.
    Get-EventLog -newest 20 -Log -Application

    is legal because we’ve used parameter names..."

    Hyphen before Application should be removed
    376763 (1) [Avatar] Offline
    #5
    Chapter 14 lab, answer to exercise #1:
    Get-CimClass win32_networkadapterconfiguration | select -expand methods | where Name -match "dhcp"

    This throws the error:
    Property "methods" cannot be found.
    445393 (1) [Avatar] Offline
    #6
    In the Appendix, Review lab 1, task 4 it asks to set BITS service to Manual but in the answer section for task 4, it sets it to Automatic
    NAllen84 (2) [Avatar] Offline
    #7
    Chapter 9 Lab Answers be trolling


    image
    Memphis Mike (3) [Avatar] Offline
    #8
    376763 wrote:Chapter 14 lab, answer to exercise #1:
    Get-CimClass win32_networkadapterconfiguration | select -expand methods | where Name -match "dhcp"

    This throws the error:
    Property "methods" cannot be found.


    Good catch. It should be ... select -expand cimclassmethods

    Same error occurs in chapter 16 Lab answers number 3's example code.
    239881 (1) [Avatar] Offline
    #9
    Section 11.5 - using the iterative command-line tool
    "We believe you know how to do the first three steps. the fourth is accomplished using your old friend, select-object"

    It then says read the help file for select-object. but select-object is then not used in the step through examples, where-object is used.



    I'm fairly sure I've not gone mad here
    ElliottMarter (1) [Avatar] Offline
    #10
    Chapter 13 Page 162

    Invoke-Command -command { dir }
    ?-computerName (Get-Content webservers.txt)

    The parentheses here force PowerShell to execute Get-Content first—the same way
    parentheses work in math. The results of Get-Command are then stuck into the
    -computerName parameter, which works against each of the computers listed in the file.


    The Get-Command in bold should be Get-Content

    John Straffin (1) [Avatar] Offline
    #11
    The second half of 18.5 ("More tricks with double quotes"), after the section on subexpressions, is incorrect. The section puts forth the idea that "the shell is smart enough to enumerate all of the objects in a collection even when you refer to a single property or method, provided that all of the objects in the collection are of the same type". In makes no mention of subexpressions, so it's left to the user to assume that this is done without using a subexpression. It then gives the following example (which does not use a subexpression):
    PS C:\> $services = get-service
    PS C:\> $var = "Service names are $services.name"
    PS C:\> $var
    Service names are AeLookupSvc ALG AllUserInstallAgent AppIDSvc Appinfo...

    The text then states that "We truncated the preceding output to save space, but we hope you get the idea."

    If the text had not been truncated, it would have been seen that, just as with the example that precedes the section, the output still ends with .name. If we alter the example slightly to print out the status of the services instead of the names, it still prints the names, but with .status at the end instead.

    PS C:\> $services = Get-Service -Name h*
    PS C:\> $services
    
    Status   Name               DisplayName
    ------   ----               -----------
    Running  hidserv            Human Interface Device Service
    Stopped  hns                Host Network Service
    Stopped  HomeGroupProvider  HomeGroup Provider
    Stopped  HvHost             HV Host Service
    
    PS C:\> $services.status
    Running
    Stopped
    Stopped
    Stopped
    PS C:\> $var = "Service statuses are $services.status"
    PS C:\> $var
    Service statuses are hidserv hns HomeGroupProvider HvHost.status


    This is not simply a typo; the concept expressed in this section is incorrect.

    Now, if the intent was to show that this is possible with a subexpression (which it is), parentheses need to be added to the example and "subexpression" should really be mentioned somewhere in the paragraph above the example.
    PS C:\> $var = "Service statuses are $($services.status)"
    PS C:\> $var
    Service statuses are Running Stopped Stopped Stopped
    pstu (3) [Avatar] Offline
    #12
    The Review Lab 1: chapters 1-6 relies on several commands not taught until chapter 8 (sort- select-). I got pretty frustrated thinking I had a solid grasp on 1-6 and getting very stuck in the review lab. The lab hints list sort-object and select-object, and I'm comfortable using help commands, but this still seemed outside of what would be an appropriate review lab.
    pstu (3) [Avatar] Offline
    #13
    Pg 170 - 13.11 Lab answers

    The lab asks you to use invoke-command to get a list of the top 10 processes for virtual memory (VM) usage. The lab answer is:

    Invoke-Command -script-block {get-process | sort VM -descending | select-first 10} -computername Server01,Server02

    The correct answer is:

    Invoke-Command -script-block {get-process | sort VM -descending | select -first 10} -computername Server01,Server02 (note the space between select and -first).


    *Remember, like page 16 taught us "It's very, very, very, very, very important to be very, very, very, very accurate when you're typing in PowerShell. In some cases, a single misplaced space, quotation mark, or even a carriage return can make everything fail."
    521929 (5) [Avatar] Offline
    #14
    Last exercise in 10.6 (p. 132 in printed book).

    "Using those additional keys makes it easier to achieve the previous example's results, and even to improve them:"
    Get-Process |
    Format-Table Name,
    @{name='VM(MB)'; expression={$_.VM};formatstring='F2'; align='right'}
    -autosize
    

    But the previous example, as the name suggests, expressed the VM in terms of megabytes by dividing by 1MB. Further, it shows them as integers. Using a format string of F2 does neither of those — it doesn't divide by 1MB, and it gives two decimals. Thus, there is no "achieving the previous example's results" — the results don't match the column header, and they're not formatted the same as the first example.
    pstu (3) [Avatar] Offline
    #15
    Page 184, 14.11 lab answers:
    Question number 3, is a two-part question related to querying a list of hotfixes with wmi and comparing to get-hotfix. The answer page incorrectly breaks it out into question number 3 and 4. After question 4, answer 5 is for question 4; answer 6 is for question 5 and 6.

    Susan Harkins commented nearly a year ago that this errata would be published somewhere, is that available I can avoid these issues as I progress through the book?
    Susan Harkins (407) [Avatar] Offline
    #16
    This book doesn't have a comprehensive errata list. I'm sorry for the inconvenience. I'll contact the author and see what we can do.

    Thank you,
    Susan Harkins
    Lee_Dailey (4) [Avatar] Offline
    #17
    4.5.3 - Incorrect position number for parameter
    howdy y'all,

    in 4.5.3 the `-Path` parameter of the `Get-ChildItem` cmdlet is listed as `1` in the `-Full` parameter help. it aint that, it's `0`. this is repeated in the line just after the parameter details. here ...

    That’s a clear indication that the -Path parameter is in position 1.


    `-Path` is the 1st parameter & parameter positions start at zero. [*grin*]

    take care,
    lee

    Lee_Dailey (4) [Avatar] Offline
    #18
    missing lab answers for 4.10 lab [and for ch17]
    howdy y'all,

    there are no answers for the labs for ch4 & 17. ch3, ch5, ch6, etc all have an answers section. that seems like a fubar. [*grin*]

    take care,
    lee

    Susan Harkins (407) [Avatar] Offline
    #19
    Have you checked the appendix? I believe that's where you'll find the answers.

    Susan Harkins
    Errata Editor.
    Lee_Dailey (4) [Avatar] Offline
    #20
    Susan Harkins wrote:Have you checked the appendix? I believe that's where you'll find the answers.

    Susan Harkins
    Errata Editor.


    howdy Susan Harkins,

    except for ch4 & ch17, the other chapters that have labs with questions [ch2 is actions, not questions] all have specific sections [ex - 3.8 Lab; 3.9 Lab Answers]. the appendix has _review_ labs, not lab answers. [*grin*]

    i hope i am not posting to the wrong book. [*blush*] i'm reading thru ...
    Learn Windows PowerShell in a Month of Lunches, Third Edition


    take care,
    lee

    Awesome (1) [Avatar] Offline
    #21
    Page: 116
    Chapter: 9
    Section: Above and beyond
    Location: Fourth paragraph

    Finding: Last line of fourth paragraph should read "Company.pri", not "Company.com"
    Jesse Silverman (4) [Avatar] Offline
    #22
    215812 wrote:the command in section 4.5.2 that ends with .computername.aliases generates an error.


    They forgot to include one of their cute "this is all one line" icons like they remember to do on p. 67. I think everything PowerShell 3.0 and above will work as long as you type it correctly.
    Jesse Silverman (4) [Avatar] Offline
    #23
    On page 67 in section 6.2.3, the explanation of that complex command has a typo:
    "The output from Import-CLI is fed to the -reference parameter,
    and the output from Get-Process is fed to the -difference parameter."
    There is no Import-CLI cmdlet, of course it means Import-CliXML.

    Even tho it is obvious, because the section is so important and the command is a bit tricky your first time (or couple of times thru) it would be good to fix it.

    I went slightly off the beaten path, and my initial experiments didn't give the results I expected for comparing lists of running processes at different times, so I'm going over this with a fine-toothed comb and doing things exactly by the book until I am sure the results are correct.
    Jesse Silverman (4) [Avatar] Offline
    #24
    At the very bottom of page 71 where you engage in some foreshadowing: "In chapter 7, we’ll dive into the rules that govern
    how commands can connect to each other."

    I think that refers to the second (or maybe even first) edition, in the third edition chapter 7 certainly doesn't cover that, and I think it is chapter 9 more than 8 where it really gets addressed.
    Jesse Silverman (4) [Avatar] Offline
    #25
    pstu wrote:The Review Lab 1: chapters 1-6 relies on several commands not taught until chapter 8 (sort- select-). I got pretty frustrated thinking I had a solid grasp on 1-6 and getting very stuck in the review lab. The lab hints list sort-object and select-object, and I'm comfortable using help commands, but this still seemed outside of what would be an appropriate review lab.


    Agreed. The big hint is "review lab". I think some of the topics got moved around in the newer edition and at this point to call it a "review lab" it would best be tackled after doing chapters 7 and 8. We know how people learn or not. It is too familiar to hear stories of "I was studying that and then I gave up when..." (frustrating event happened).

    Another independent hint is Don's videos (which are still awesome). Get-Member and sorting are both covered in videos for Chapter 6, which is I am guessing where these were explained in the first edition, if not the second as well.

    People should just hold off on the review lab until chapter 8 probably.
    Michael-Bender (3) [Avatar] Offline
    #26
    Any word on an official errata for this book besides digging through a forum?

    Thanks.

    Michael-Bender (3) [Avatar] Offline
    #27
    Answers to Chapter 9, #4 and #5

    #4
    get-adcomputer -Filter * |
    select-object -Property @{name='computername';expression={$_.Name}} |
    Get-Process

    #5
    Get-service -ComputerName (Get-ADComputer -Filter *|Select-Object -ExpandProperty Name)
    Susan Harkins (407) [Avatar] Offline
    #28
    Thanks for your inquiry regarding an official errata list. At this time, there isn't one, and I don't know if the author intends to generate one. I'm sorry for any inconvenience.

    Susan Harkins
    Errata Editor
    611490 (1) [Avatar] Offline
    #29
    Chap 9, Lab Answer #5 produces BIOS information vice what the question is asking for which is a list of running services.