在我的腳本中,我想讓Exchange Online分發組成員加入我的數組$members_id
。Invoke-Command的問題
我想在遠程服務器上運行該cmdlet Get-DistributionGroupMember
所以它看起來是這樣的:
Invoke-Command -Session $Session -ScriptBlock {
$members_id = Get-DistributionGroupMember -Identity "power_shell_test"
} -ArgumentList $members_id
運行此之後,我得到一個錯誤:
The syntax is not supported by this runspace. This can occur if the runspace is in no-language mode.
當我刪除$members_id =
它運行良好。
請告訴我,如果你有一個想法,它爲什麼這樣工作。
我會說「與調用命令的問題「是不是一個有意義的標題... – Clijsters