Skip to content

Get-AtwsTicket -Filter #122

@carterduplessis

Description

@carterduplessis

@klemmestad Thanks so much for your recent support on this module! This is making so many lives so much easier :)

I can't figure this one out. When I try to use Get-AtwsTicket with the -Filter parameter inside of a foreach loop, it throws this error:

image

I built a function which is an example of how I got this output:

Function Get-Tickets {
    Param(
        [Parameter(Mandatory=$true)][int]$ParentID
        )
    
    $ChildClients = Get-AtwsAccount -ParentAccountID $ParentID
    
    Foreach($ChildClient in $ChildClients){
        $Tickets = Get-AtwsTicket -Filter {AccountID -eq $ChildClient.id} | Sort CreateDate
    }
}

It seems like the Filter parameter for this cmdlet has trouble using variables that are passed in via foreach loops. Does this issue you replicate for anyone else? I tested this on PS 5.1 and 7.3.2.

Thanks,
Carter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions