user1866880
user1866880

Reputation: 1467

the "%" character in powershell

I am new to powershell, and I saw this code snippet recently:

$users = Get-User 
$users | % { $user = $_; Get-MailboxStatistics $_ | % 
    { 
        "User name:{0} - some mailbox statistics: {1}" -f $user.SomePropertyOfUser, $_.SomePropertyOfMailbox
    } 
}

What does the % mean here? It seems to be marking the beginning of a block of code, is that right? many thx!

Upvotes: 0

Views: 97

Answers (1)

Loïc MICHEL
Loïc MICHEL

Reputation: 26140

this is an alias for the foreach-object cmdlet

another other alias frequently use is : ? that stands for where-object

Upvotes: 3

Related Questions