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!
this is an alias for the
foreach-objectcmdletanother other alias frequently use is :
?that stands forwhere-object