Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Bug with filters that have 0 values (Severity, resolution status) #65

Open
shawnparr opened this issue Jan 13, 2020 · 1 comment
Open

Comments

@shawnparr
Copy link

In Get-MCASAlert.ps1 on lines 198 and 199 certain filters will never work. For instance the value of the resolution status of "Open" is 0, therefore the line:

if ($ResolutionStatus) {$filterSet += @{'resolutionStatus'= @{'eq'=([int[]]($ResolutionStatus | ForEach-Object {$_ -as [int]}))}}}

Will always evaluate to false and not add the filter to the filter set since 0 matches as $false in PowerShell. As such it is impossible to query for Open cases.

@martin-rublik
Copy link

easy fix would be

if ($PSBoundParameters.ContainsKey('ResolutionStatus')) {$filterSet += @{'resolutionStatus'= @{'eq'=([int[]]($ResolutionStatus | ForEach-Object {$_ -as [int]}))}}}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants