Does anyone know any way to trap warnings?
I have a client with a large Exchange 2007 server (>1000 mailboxes). A simple "get-mailbox" generates a lot of warnings (mostly things like "...is not valid for Alias..."
. I'd like to capture those so we can have the help desk start fixing them, but I can't find a way to do it.
I/O redirection doesn't work (neither to stdlist or stderr). $warningPreference doesn't have any useful options (for this purpose).
What I'd like is -WarningVariable, but that doesn't exist.
Any ideas?