Instantly share code, notes, and snippets.

Embed
What would you like to do?
Parse MS Graph JSON Batch Responses
foreach ($jobRMResult in $getBatchRequestRM.responses) {
$jobRMResult.id
write-host -ForegroundColor blue "jobID: $($jobRMResult.id)"
if ($jobRMResult.body.value.count -gt 1){
foreach ($entry in $jobRMResult.body.value){
write-host -ForegroundColor cyan " $($entry)"
}
} else {
write-host -ForegroundColor cyan " $($jobRMResult.body.value)"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment