【发布时间】:2017-01-31 21:47:27
【问题描述】:
我正在尝试使用 powershell 脚本从 Exchange Online 2016 中获取一些信息。这里我使用这个脚本
$UserCredential = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $(convertto-securestring $Password -asplaintext -force)
$ExchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $UserCredential -Authentication "Basic" -AllowRedirection
Import-PSSession $ExchangeSession -DisableNameChecking
我得到以下输出:
ModuleType 版本名称 ExportedCommands
---------- -------- ---- ----
脚本 1.0 tmp_avadkvxn.tjc Get-MailboxUsageReport
我的问题是, 我不希望在我的输出中出现上述消息。如何压制这个?我只想要确切的输出。这里我没有提到我使用的命令。在尝试导入会话时,它在控制台中提供此信息消息,如何抑制此
提前致谢,
阿鲁尔
【问题讨论】:
-
谁能帮帮我
-
Import-PSSession返回模块对象。重定向该命令的结果应该足够了,例如$null = Import-PSSession ...
标签: powershell exchange-server