I'm having a problem with -errorvariable not working with any of the Exchange cmdlets. When I perform a command like "Get-Mailbox -Identity userthatdoesntexist -ErrorVariable myerror", it does not save the error to $myerror, it doesn't even appear to create the variable. I can use -errorvariable with non-exchange cmdlets with no problem at all. I have tried "-ErrorVariable +myerror" also but I receive the same results. I have tried this on a few different computers (even on the Exchange server itself), it doesn't work anywhere. Does anyone have any thoughts why this might be happening? Thanks for any suggestions.
↧