dan
dan

Reputation: 515

ExchangeOnlineManagement module, suppress update message in runbook

An Azure Automation account runbook uses the ExchangeOnlineManagement module. A particular cmdlet is spewing a long message (below) about updating to version 2.0.6, which is still in preview.

I assume, because it's in preview, it doesn't show up in the "add module from PowerShell Gallery" in the Azure Portal. I cannot figure out how to update our Azure automation account to use 2.0.6-Preview6, and only 2.0.5 is listed for import.

Anyway, how can I suppress this message? I have the runbook getting fired from a MS Flow, and parsing JSON from the runbook output chokes on the unexpected non-JSON string.

Here's the cmdlet in question that produces the message:

$exchangeConnection = Connect-ExchangeOnline -ExchangeEnvironmentName O365USGovGCCHigh –CertificateThumbprint $connection.CertificateThumbprint –AppId $connection.ApplicationID –ShowBanner:$false –Organization $tenant | Out-Null

Here's the annoying message that is output:

=============================================================

New update available!
You are using an older version of Exchange PowerShell cmdlets which may be using (soon to be deprecated) Basic authentication.
Please install version 2.0.6 of the ExchangeOnlineManagement module to upgrade to the latest version of cmdlets, which are REST based, more secure, reliant and performant than the remote PowerShell cmdlets that you are currently using.

For more information on the latest cmdlets released, visit: https://techcommunity.microsoft.com/t5/exchange-team-blog/exchange-online-powershell-v2-module-preview-now-more-secure/ba-p/2922946
To download the latest version of the module, visit https://www.powershellgallery.com/packages/ExchangeOnlineManagement/2.0.6-Preview5

============================================================

Upvotes: 1

Views: 265

Answers (1)

KrishnaG
KrishnaG

Reputation: 3484

Were you not able to supress it by including -WarningAction SilentlyContinue or >$null 2>&1 or | out-null. Anyway, now the issue should have been resolved as you could import 3.1.0 version.

enter image description here

Upvotes: 0

Related Questions