prevention-policies/Edit-CsPreventPolicy.psm1
function Edit-CsPreventPolicy { <# .SYNOPSIS Update Prevention Policies by specifying the ID of the policy and details to update .PARAMETER RESOURCES An array of Prevention policy properties #> [CmdletBinding()] [OutputType([psobject])] param( [Parameter(Mandatory = $true)] [array] $Resources ) process{ $Param = @{ Uri = '/policy/entities/prevention/v1' Method = 'patch' Header = @{ accept = 'application/json' 'content-type' = 'application/json' } Body = @{ resources = $Resources } | ConvertTo-Json -Depth 16 } switch ($PSBoundParameters.Keys) { 'Verbose' { $Param['Verbose'] = $true } 'Debug' { $Param['Debug'] = $true } } Invoke-CsAPI @Param } } |