Public/Get-TmdsFileList.ps1
function Get-TmdsFileList { [CmdletBinding(DefaultParameterSetName = 'All')] [Alias('')] param ( [parameter(ParameterSetName = 'All')] [switch]$All, [parameter( ParameterSetName = 'ById', ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias('Id')] [int[]]$FileListId ) process { If ($PSCmdlet.ParameterSetName -eq 'ById') { foreach ($id in $FileListId) { $Resource = "filelists/$id" $params = @{ 'Resource' = $Resource 'Method' = "Get" } Invoke-TmdsApiCall @params } } Else { $Resource = "filelists" $params = @{ 'Resource' = $Resource 'Method' = "Get" } (Invoke-TmdsApiCall @params).fileLists } } } |