$secpasswd = ConvertTo-SecureString "<api_password>" -AsPlainText -Force $mycreds = New-Object System.Management.Automation.PSCredential ( "webapi" , $secPasswd) $url = "https://iawebapi.automatedvision.info:8081//Dispatcher/SchedulingService" $Modules = @() [xml]$Temp_Modules = (Invoke-WebRequest -Uri $url/what/modules -Method GET -Credential $mycreds).Content if ($temp_Modules){[array]$Modules = $Temp_Modules.JobWhatList.JobWhat [array]$Modules = $Modules | sort-object Name} $Modules $Projects = @() [xml]$Temp_Projects = (Invoke-WebRequest -Uri $url/what/projects -Method GET -Credential $mycreds).Content if ($temp_Projects){[array]$Projects = $Temp_Projects.JobWhatList.JobWhat [array]$Projects = $Projects | sort-object Name} $Projects $Runbooks = @() [xml]$Temp_Runbooks = (Invoke-WebRequest -Uri $url/what/runbooks -Method GET -Credential $mycreds).Content if ($temp_Runbooks){[array]$Runbooks = $Temp_Runbooks.JobWhatList.JobWhat [array]$Runbooks = $Runbooks | sort-object Name} $Runbooks $agents = @() [xml]$temp_agents = (Invoke-WebRequest -Uri $url/who?agents=true -Credential $mycreds).Content if ($temp_agents){[array]$agents = $temp_agents.JobWhoList.JobWho [array]$agents = $agents | sort-object Name} $agents