Functions/Remove-IADefaultView.ps1
Function Remove-IADefaultView { [CmdletBinding()] Param( [Parameter(Mandatory = $true, ParameterSetName = 'IADefaultView', ValueFromPipeline = $true)] [PSObject] $IADefaultView, [Parameter(Mandatory = $true, ParameterSetName = 'Id', ValueFromPipelineByPropertyName = $true)] [Guid] $Id ) Process { if($IADefaultView){ foreach($defaultview in $IADefaultView){ $Uri = "DefaultViews($($defaultview.Id))" $response = Invoke-IAQuery -QueryUrl $Uri -Method Delete if ($null -eq $response.value) { return $null } return $response.value } } if($Id){ foreach($item in $Id){ $Uri = "DefaultViews($item)" $response = Invoke-IAQuery -QueryUrl $Uri -Method Delete if ($null -eq $response.value) { return $null } return $response.value } } } } |