functions/Get-JobStatus.ps1
<#
.SYNOPSIS Returns Job status for given Job Identifier .DESCRIPTION Returns Job status for given Job Identifier .EXAMPLE Get-JobStatus "asdf8sfsd98sa8sd9a9f" Output { "jobId": "string", "status": "queued" } #> Function Get-JobStatus { [cmdletbinding()] param( [Parameter(Mandatory=$true)] [string]$JobID ) $JobID = $JobID.ToLower() $uri = $CDXSERVER + "/api/jobs/" + $JobID $JobStatus = Invoke-RestMethod -Uri $uri -Method Get -Headers $headers -ContentType "application/json" Write-Verbose ( $JobStatus | Format-Table | Out-String ) Return $JobStatus } |