Public/Get-LprMatchList.ps1
function Get-LprMatchList { <# .SYNOPSIS Gets one or more LPR Match List objects .DESCRIPTION Gets one or more LPR Match List objects. The Name parameter is optional and supports wildcards. When omitted, the default value for Name is '*' and all match lists will be returned. .EXAMPLE PS C:\> Get-LprMatchList -Name Staff Gets the LPR Match List named 'Staff' or returns an error if no such list is found. #> [CmdletBinding()] [OutputType([VideoOS.Platform.ConfigurationItems.LprMatchList])] param( # Specifies the name of the LPR Match List to get. Wildcards are supported. [Parameter(ValueFromPipelineByPropertyName)] [string] $Name = '*' ) begin { $ms = Get-ManagementServer if ($null -eq $ms.LprMatchListFolder) { throw "Milestone XProtect LPR Plugin is not installed or was not loaded in the current session. Please ensure the plugin is installed. If LPR cannot be managed from Management Client on this system, it cannot be managed from PowerShell either." } } process { $resultFound = $false foreach ($list in $ms.LprMatchListFolder.LprMatchLists) { if ($list.Name -like $Name) { $resultFound = $true Write-Output $list } } if (-not $resultFound) { Write-Error "No LPR Match List found matching filter `"Name -like '$Name'`"" -Category ObjectNotFound } } } |