public/Get-VSASessionTimer.ps1
function Get-VSASessionTimer { <# .Synopsis Returns all of the SessionTimers. .DESCRIPTION Returns all of the SessionTimers associated with the sessionId. Returns all of the Activity Types associated with the customer in scope of the sessionId. .PARAMETER VSAConnection Specifies existing non-persistent VSAConnection. .PARAMETER URISuffix Specifies URI suffix if it differs from the default. .PARAMETER TimerId Specifies id of the session timer, if provided. .PARAMETER Filter Specifies REST API Filter. .PARAMETER Paging Specifies REST API Paging. .PARAMETER Sort Specifies REST API Sorting. .EXAMPLE Get-VSASessionTimer .EXAMPLE Get-VSASessionTimer -VSAConnection $connection .INPUTS Accepts piped non-persistent VSAConnection .OUTPUTS Array of items that represent session timers #> [CmdletBinding()] param ( [parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true)] [VSAConnection] $VSAConnection, [parameter(DontShow, Mandatory=$false, ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [string] $URISuffix = 'api/v1.0/system/sessiontimers', [parameter(Mandatory=$false, ValueFromPipelineByPropertyName=$true)] [ValidateScript({ if( (-not [string]::IsNullOrEmpty($_)) -and ($_ -notmatch "^\d+$") ) { throw "Non-numeric Id" } return $true })] [string] $TimerId, [parameter(Mandatory=$false, ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [string] $Filter, [parameter(Mandatory=$false, ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [string] $Paging, [parameter(Mandatory=$false, ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [string] $Sort ) if( -not [string]::IsNullOrWhiteSpace( $TimerId) ) { $URISuffix = "api/v1.0/system/sessiontimers/$TimerId" } [hashtable]$Params = @{ URISuffix = $URISuffix VSAConnection = $VSAConnection Filter = $Filter Paging = $Paging Sort = $Sort } foreach ( $key in $Params.Keys.Clone() ) { if ( -not $Params[$key]) { $Params.Remove($key) } } return Invoke-VSARestMethod @Params } Export-ModuleMember -Function Get-VSASessionTimer |