What does this abbreviation mean?(beginner here)

Welcome Forums General PowerShell Q&A What does this abbreviation mean?(beginner here)

This topic contains 3 replies, has 3 voices, and was last updated by

 
Participant
3 years, 4 months ago.

  • Author
    Posts
  • #28631

    Participant
    Points: 0
    Rank: Member

    Hi I'm very new to Powershell and I'm trying to figure the basics out myself but in this code shared in the jump start on virtual academy I cannot figure out what 'e' is on line 2.

    Code:

    Get-WmiObject win32_logicaldisk -filter "DeviceID='c:'" |
    Select @{n='freegb';e={$.freespace / 1gb -as [int]}}

    Because of the output I know n=name, but e is a mystery to me. I'm just trying to figure out WHY this select statement works.

  • #28632

    Participant
    Points: 0
    Rank: Member

    e stands for expression

    – Chris

  • #28634

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

    e means "expression" and it calculates what will appear in the custom property. This is also covered in "Learn Windows PowerShell in a Month of Lunches," if you're looking for more formal coverage of the basics. The MVAs skip over a lot of details.

  • #28636

    Participant
    Points: 0
    Rank: Member

    Ahhh thanks. Yes, I need to get that book.

The topic ‘What does this abbreviation mean?(beginner here)’ is closed to new replies.