Public/NamingContexts/Disable-R1NamingContext.ps1
|
# .ExternalHelp psRadiantOne-help.xml function Disable-R1NamingContext { [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Medium')] [OutputType([void])] param( [parameter( Mandatory = $true, ValueFromPipelineByPropertyName = $true )] [ValidateNotNullOrEmpty()] [string]$dn ) Begin { Assert-R1Session -RequireToken }#begin Process { $URI = Resolve-R1ServiceUrl -Service Namespace -Path "naming_contexts/$($dn | Get-EscapedString)/toggle_active" $Body = @{ isActive = $false } | ConvertTo-R1JsonBody if ($PSCmdlet.ShouldProcess($dn, 'Deactivate Naming Context')) { $null = Invoke-R1RestMethod -Uri $URI -Method PUT -Body $Body } }#process End { }#end } |