I am trying to execute the Powershell command:
Stop-BrokerSession 2904
That number, 2904, definitely shows up in the results as seen in the code below. I used MessageBox.Show to verify the right number for the session id. However, for some reason I get this binding error. I can type that command in at the powershell prompt and it works fine, but when trying to execute it here I get this binding exception. What's the deal?
My guess as to what is wrong is that this parameter doesn't have a name. It's just a number. You put the command and the session id next to it but there isn't a name for it, it's not like "Stop-BrokerSession -SessionId 2904" it's just "Stop-BrokerSession 2904" and that I think is the issue.
Also this doesn't work:
logoff.parameters.Add(null, x.Properties["Uid"].Value.ToString());