Month of Lunches Help

Welcome Forums General PowerShell Q&A Month of Lunches Help

This topic contains 1 reply, has 2 voices, and was last updated by

 
Keymaster
2 years, 1 month ago.

  • Author
    Posts
  • #55157

    Participant
    Points: 1
    Rank: Member

    Hello,

    I recently began going through the Learn Powershell in a month of lunches book. I am currently on chapter 9. I am happy to say that I understand most of the concepts. However, one thing is getting me. While working on lab exercise 3, I have the following question: What determines the values of "l" and "e" that are used in the following:

    get-adcomputer -filter * |
    Select-Object @{l='computername';e={$_.name}} |
    Get-Hotfix

    I cannot see where it is dictated what needs to be used or where these letters come from. I tried to substitute a "b" in place of the "l" and get an error... These values seem to be arbitrary as they just accept the values we assign. please explain if possible.

    Best Regards,

    Eric D. Craven

  • #55158

    Keymaster
    Points: 1,624
    Helping HandTeam Member
    Rank: Community Hero

    The "L" and "E" are part of the command syntax. They stand for Label and Expression (which can also be used). They're hardcoded in by whomever wrote the Select-Object command. They're also documented in the Full help for Select-Object, and are also usable in the Format- commands.

    Those're actually explained in the book, too, in the bullet list following Figure 9.12.

The topic ‘Month of Lunches Help’ is closed to new replies.