if (get-mailboxdatabase mydatabase -ea silentlycontinue){ Write-Output "Found mydatabase" } else{ Write-Output "mydatabase is not found" }
A typo on my end: How does this look? It seems to be working on my end.$mailboxdatabase = getmailboxdatabase mydatabase -Erroraction Silentlycontinue if (!$mailboxdatabase) { Do actionA } else { Do ActionA }