我正在尝试执行单个联系人 IM 的脚本(通过 Microsoft Lync),并已成功运行脚本一直到最后一行:
$null = $m.BeginSendMessage($d, $null, $d)
笔记:
$d = New-Object "System.Collections.Generic.Dictionary [Microsoft.Lync.Model.Conversation.InstantMessageContentType, String]"
$d.Add($PlainText, "This is a test.")
以下是执行此语法时 Psh 引发的异常。它似乎在启动 $null 变量时失败。
Exception calling "BeginSendMessage" with "3" argument(s): "Value does not fall within the expected range."
At C:\ScriptsPS\IM_SingleContact.ps1:75 char:1
+ $null = $m.BeginSendMessage($d, $null, $d)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~