Build: v5.7.181
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.19041.0
I created a Windows Form project. In it, the O365 function Get-EXOMailbox is called and returns a value to a variable as expected. However, a Windows form messagebox is also splashed with the message "Count of Objects Returned: 1". If a loop calls Get-EXOMailbox 200 times, 200 messages are splashed and cannot be cleared until the loop ends. (See attachment).
I can find no way to suppress this message box. None of the standard methods seem to work or, if they do, also prevent Get-EXOMailbox returning any data.
For example, the script authenticates to O365 using Connect-ExchangeOnline, and is executed as follows:
- Import-Module ExchangeOnlineManagement
- Connect-ExchangeOnline -UserPrincipalName $UPN -ShowProgress $true -Credential $O365Credentials
- $entry = Get-EXOMailbox smithj | Select DisplayName, GrantSendOnBehalfTo, RecipientTypeDetails
If I package the script to an .EXE or export the Form Project and run it as a script in PowerShell_ISE, the additional message box is NOT produced. It only occurs running inside the PowerShell Studio IDE using Run or Debug Run.