I'm trying to run Exchange 2010 cmdlets such as this one:
Get-Mailbox UserName -ErrorVariable err
However, the cmdlets seem to completely ignore the
-ErrorVariable parameter: the variable
$err is never created or modified, regardless of the command's success or failure.
Why is this happening, and how can I make them work like they should (i.e. populating the variable with the actual command result)?
This works perfectly on Exchange 2007, or with any other cmdlet which isn't specific to Exchange 2010.