So here's the powershell:
$app = Get-WmiObject -Class SMS_UserApplicationRequest -Namespace root/SMS/site_sitename -
ComputerName computername | Select-Object User, Application, RequestGUID
$app
It works fine, returns the info with no problem.
Running in c#:
Runspace runspace = RunspaceFactory.CreateRunspace();
runspace.Open();
PowerShell powerShell = PowerShell.Create();
powerShell.Runspace = runspace;
powerShell.AddScript(script);
Collection<PSObject> results = powerShell.Invoke();
foreach (PSObject result in results)
{
MessageBox.Show(result.ToString());
}
runspace.Close();
This shows the baseObject, which is the UserApplicationRequest, but how do I access the data in the request? (That was the Select-Object User, Application, RequestGUID)