有没有人使用过 Citrix 7.6 BrokerSession SDK?我不知道如何执行这样的命令,例如:
GetBrokerSessionCommand getCmd = new GetBrokerSessionCommand();
getCmd.AdminAddress = "citrixServer:80";
var result = getCmd.Invoke();
这给了我一条错误消息:“不能直接调用从 PSCmdlet 派生的 Cmdlet。
在早期的 6.5 SDK 中,我可以这样做:
string[] servers = new string[] { };
GetXAWorkerGroupByName workerGroup = new GetXAWorkerGroupByName();
workerGroup.WorkerGroupName = new string[] { workerGroupName };
workerGroup.ComputerName = XenAppController;
foreach (XAWorkerGroup _workerGroup in CitrixRunspaceFactory.DefaultRunspace.ExecuteCommand(workerGroup))
{
servers = _workerGroup.ServerNames;
}
return servers;
但是现在 CitrixRunspaceFactory 已经不存在了?出于以更简单的方式处理异常的简单原因,我想避免使用 Powershell 类和 Powershell.Create() 执行命令。