在 PowerShell 中连接到 Exchange Online 时停止输出
Stop output when connecting to Exchange Online in PowerShell
我目前正在构建连接到 Exchange Online 的 Office 365 PowerShell 应用程序:
Connect-ExchangeOnline
虽然它工作得很好,但在连接到租户时出现了一个小的、微不足道的但令人讨厌的事件 - 显示以下输出:
----------------------------------------------------------------------------
We have released new management cmdlets which are faster and more reliable.
|--------------------------------------------------------------------------|
| Old Cmdlets | New/Reliable/Faster Cmdlets |
|--------------------------------------------------------------------------|
| Get-CASMailbox | Get-EXOCASMailbox |
| Get-Mailbox | Get-EXOMailbox |
| Get-MailboxFolderPermission | Get-EXOMailboxFolderPermission |
| Get-MailboxFolderStatistics | Get-EXOMailboxFolderStatistics |
| Get-MailboxPermission | Get-EXOMailboxPermission |
| Get-MailboxStatistics | Get-EXOMailboxStatistics |
| Get-MobileDeviceStatistics | Get-EXOMobileDeviceStatistics |
| Get-Recipient | Get-EXORecipient |
| Get-RecipientPermission | Get-EXORecipientPermission |
|--------------------------------------------------------------------------|
To get additional information, run: Get-Help Connect-ExchangeOnline
Please send your feedback and suggestions to exocmdletpreview@service.microsoft.com
----------------------------------------------------------------------------
这没什么大不了的,对我的应用程序的功能绝对没有影响。只是有点碍眼,我承认自己是个完美主义者!有什么办法可以抑制这个输出吗?强制转换为 null 似乎不起作用,而且我无法在其他任何地方找到任何可能的技巧。
非常感谢!
如果不想在屏幕上输出,可以使用变量
$Connect=Connect-ExchangeOnline
或者你可以使用 out null
Connect-ExchangeOnline | Out-Null
根据您的模块版本,尝试添加 -ShowBanner:$false
开关 (source):
Connect-ExchangeOnline -ShowBanner:$false
另一种可能是将 HideBannermessage=true
作为参数添加到您的 URI (source):
Connect-ExchangeOnline -ConnectionUri "https://outlook.office365.com/powershell-liveid/?HideBannermessage=true"
我目前正在构建连接到 Exchange Online 的 Office 365 PowerShell 应用程序:
Connect-ExchangeOnline
虽然它工作得很好,但在连接到租户时出现了一个小的、微不足道的但令人讨厌的事件 - 显示以下输出:
----------------------------------------------------------------------------
We have released new management cmdlets which are faster and more reliable.
|--------------------------------------------------------------------------|
| Old Cmdlets | New/Reliable/Faster Cmdlets |
|--------------------------------------------------------------------------|
| Get-CASMailbox | Get-EXOCASMailbox |
| Get-Mailbox | Get-EXOMailbox |
| Get-MailboxFolderPermission | Get-EXOMailboxFolderPermission |
| Get-MailboxFolderStatistics | Get-EXOMailboxFolderStatistics |
| Get-MailboxPermission | Get-EXOMailboxPermission |
| Get-MailboxStatistics | Get-EXOMailboxStatistics |
| Get-MobileDeviceStatistics | Get-EXOMobileDeviceStatistics |
| Get-Recipient | Get-EXORecipient |
| Get-RecipientPermission | Get-EXORecipientPermission |
|--------------------------------------------------------------------------|
To get additional information, run: Get-Help Connect-ExchangeOnline
Please send your feedback and suggestions to exocmdletpreview@service.microsoft.com
----------------------------------------------------------------------------
这没什么大不了的,对我的应用程序的功能绝对没有影响。只是有点碍眼,我承认自己是个完美主义者!有什么办法可以抑制这个输出吗?强制转换为 null 似乎不起作用,而且我无法在其他任何地方找到任何可能的技巧。
非常感谢!
如果不想在屏幕上输出,可以使用变量
$Connect=Connect-ExchangeOnline
或者你可以使用 out null
Connect-ExchangeOnline | Out-Null
根据您的模块版本,尝试添加 -ShowBanner:$false
开关 (source):
Connect-ExchangeOnline -ShowBanner:$false
另一种可能是将 HideBannermessage=true
作为参数添加到您的 URI (source):
Connect-ExchangeOnline -ConnectionUri "https://outlook.office365.com/powershell-liveid/?HideBannermessage=true"