Has anyone worked with the Citrix 7.6 BrokerSession SDK? I can't figure out how to execute a command like this for example:
GetBrokerSessionCommand getCmd = new GetBrokerSessionCommand();
getCmd.AdminAddress = "citrixServer:80";
var result = getCmd.Invoke();
This gives me an error message saying: "Cmdlets derived from PSCmdlet cannot be invoked directly.
In the earlier 6.5 SDK I could do like this:
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;
But now the CitrixRunspaceFactory no longer exists? I want to avoid executing the command with the Powershell class and Powershell.Create() for the simple reason of handling exceptions in a simpler way.