Private/Invoke/Invoke-CWMPutMaster.ps1
function Invoke-CWMPutMaster { [CmdletBinding()] param ( $Object, [string]$Endpoint ) Write-Verbose $Object #Write-Verbose $Arguments.Value #$global:TArguments = $Arguments $URI = New-CWMUrl -Endpoint $Endpoint $Body = $Object $Body = $(ConvertTo-Json -inputobject $Body -depth 8 ) Write-Verbose $Body $WebRequestArguments = @{ Uri = $URI Method = 'Put' ContentType = 'application/json' Body = $Body } $Result = Invoke-CWMWebRequest -Arguments $WebRequestArguments if($Result.content){ $Result = $Result.content | ConvertFrom-Json } return $Result } |