Public/Get-ViewGroupData.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#Requires -Modules 'MilestonePSTools'

function Get-ViewGroupData {
    <#
    .SYNOPSIS
        Gets the ViewGroupData from the Management Server through the IServerCommandService interface
    .DESCRIPTION
        ViewGroupData contains a ViewGroupDataXml property which contains the definition for all views and groups
        within a Public View Group shared by one or more roles. This cmdlet will retrieve a
        [VideoOS.Common.Proxy.Server.WCF.ViewGroupInternal] object by ID, and you can then manipulate the properties
        of the ViewGroupData before sending it back to the Management Server through Set-ViewGroupData.
    .EXAMPLE
        PS C:\> $data = $vg = Get-ViewGroup -Name 'Remote Guards' | Get-ViewGroupData
        Retrieve the contents or data for the View Group named 'Remote Guards'
    .INPUTS
        Takes a guid representing an existing View Group ID. You can get this from a call to Get-ViewGroup.
    #>

    [CmdletBinding()]
    param (
        [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)]
        [Guid]
        $Id
    )

    begin {
        $svc = Get-IServerCommandService
    }

    process {
        Write-Output ($svc.GetViewGroupData((Get-Token), $Id))
    }
}