Hi PChip1976 ,
thanks a lot for your Code triggering a Runbook with Orchestraor 2022 webAPI!
I can pass a value for a parameter in the Initialize Data activity like below:
$OrchURI = 'https://sco2022.stefan.local' #Replace 5001 by the WebService port
$RunbookPath = '\Test\TEST.Runbook'
$RunbookID = ((Invoke-RestMethod -uri ('{0}/api/Runbooks' -f $OrchURI) -UseDefaultCredentials) | Select -ExpandProperty value | where {$_.Path -eq $RunbookPath}).Id
# To Start a job
$body = @{
RunbookId = $RunbookID
Parameters = @(
[pscustomobject]@{Name='HyperVName';Value='HyperV01'}
)
CreatedBy = $null
} | ConvertTo-Json
Invoke-RestMethod -Uri ('{0}/api/Jobs' -f $OrchURI) -Body $body -Method Post -ContentType 'application/json' -UseDefaultCredentials