public/Get-VSAMonitorLog.ps1
function Get-VSAMonitorLog { <# .Synopsis Returns VSA monitor action log. .DESCRIPTION Returns the VSA monitor action log records for given Agent Id. Takes either persistent or non-persistent connection information. .PARAMETER VSAConnection Specifies existing non-persistent VSAConnection. .PARAMETER URISuffix Specifies URI suffix if it differs from the default. .PARAMETER AgentId Specifies Agent Id to return the agent procedures' log. .PARAMETER Filter Specifies REST API Filter. .PARAMETER Paging Specifies REST API Paging. .PARAMETER Sort Specifies REST API Sorting. .EXAMPLE Get-VSAMonitorLog -AgentId '00001' .EXAMPLE Get-VSAMonitorLog -VSAConnection $connection -AgentId '00001' .INPUTS Accepts piped non-persistent VSAConnection .OUTPUTS Array of objects that represent the VSA monitor action log #> [CmdletBinding()] param ( [parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'NonPersistent')] [VSAConnection] $VSAConnection, [parameter(Mandatory=$false, ValueFromPipelineByPropertyName=$true, ParameterSetName = 'NonPersistent')] [parameter(Mandatory=$false, ValueFromPipelineByPropertyName=$true, ParameterSetName = 'Persistent')] [ValidateNotNullOrEmpty()] [string] $URISuffix = "api/v1.0/assetmgmt/logs/{0}/monitoractions", [Parameter(Mandatory = $true)] [ValidateScript({ if( $_ -notmatch "^\d+$" ) { throw "Non-numeric Id" } return $true })] [string] $AgentId, [Parameter(ParameterSetName = 'Persistent', Mandatory = $false)] [Parameter(ParameterSetName = 'NonPersistent', Mandatory = $false)] [ValidateNotNullOrEmpty()] [string] $Filter, [Parameter(ParameterSetName = 'Persistent', Mandatory = $false)] [Parameter(ParameterSetName = 'NonPersistent', Mandatory = $false)] [ValidateNotNullOrEmpty()] [string] $Paging, [Parameter(ParameterSetName = 'Persistent', Mandatory = $false)] [Parameter(ParameterSetName = 'NonPersistent', Mandatory = $false)] [ValidateNotNullOrEmpty()] [string] $Sort ) $URISuffix = $URISuffix -f $AgentId [hashtable]$Params =@{ URISuffix = $URISuffix } if($VSAConnection) {$Params.Add('VSAConnection', $VSAConnection)} if($Filter) {$Params.Add('Filter', $Filter)} if($Paging) {$Params.Add('Paging', $Paging)} if($Sort) {$Params.Add('Sort', $Sort)} return Get-VSAItems @Params } Export-ModuleMember -Function Get-VSAMonitorLog |