Functions/Set-IAConfiguration.ps1
Function Set-IAConfiguration { Param( [Parameter(Mandatory = $true)] [PSObject] $IAConfiguration ) $UriMetadataRemoved = $IAConfiguration.'@odata.context'.Replace("`$metadata#", "") $UriTrimmed = $UriMetadataRemoved.TrimEnd("/`$entity") + "($($IAConfiguration.Id))" $Uri = $UriTrimmed.Split("/")[-2] + "/" + $UriTrimmed.Split("/")[-1] $Body = $IAConfiguration | ConvertTo-Json Write-Verbose "Body: $Body" $response = Invoke-IAQuery -QueryUrl $Uri -Method Patch -Body $Body if ($null -eq $response.value) { return $null } return $response.value } |