So what I'm trying to do is this
$corruptAccounts = Get-Mailbox | select-string -pattern WARNING
The intent is to fill the variable $corruptAccounts with the warnings from Get-Mailbox. What actually happens is it processes the Get-Mailbox command, displaying the warnings, and puts nothing into the variable.
I'm new to powershell so I'm still trying to learn some of the basics.