Public/New-IAMCoreSyncJob.ps1
|
function New-IAMCoreSyncJob { [CmdletBinding(SupportsShouldProcess = $true)] param () if ($PSCmdlet.ShouldProcess("Creating IAM Core sync job")) { $Result = Invoke-RestMethod -Uri "$Script:APIRoot/sync/jobs/" -Headers (Get-IAMCoreHeader) -Method Post -ContentType "application/json" -Body '{}' if ($Result.IsSuccess) { return $Result.Data } else { throw "Failed to create IAM Core sync job: $($Result.ErrorMessage)" } } } |