【发布时间】:2016-04-27 11:23:42
【问题描述】:
谁能向我解释我在使用| 将一个命令传递给另一个命令或使用$ 以不同方式“传递”它时看到的差异(抱歉,不确定是否使用$实际上正在考虑管道)。
所以……这行得通:
Get-Mailbox -ResultSize Unlimited |
where { $_.RecipientTypeDetails.tostring() -eq "SharedMailbox" } |
Get-MailboxPermission
这很棒,但是因为我想在上面不起作用的 Get-MailboxPermission 之后放置另一个 where 命令,然后我尝试使用它:
$Mailbox = Get-Mailbox -ResultSize Unlimited |
where { $_.RecipientTypeDetails.tostring() -eq "SharedMailbox" }
Get-MailboxStatistics -Identity $Mailbox |
where { $_.IsInherited.tostring() -eq "False" }
这导致我收到此错误:
无法处理参数“身份”的参数转换。无法将“System.Collections.ArrayList”类型的“System.Collections.ArrayList”值转换为“Microsoft.Exchange.Configuration.Tasks.GeneralMailboxOrMailUserIdParameter”类型。
当然使用| 或$ 是一样的,因为它将结果传递给下一个命令,还是我完全错了?
【问题讨论】:
标签: powershell pipe exchange-server