Reputation: 597
I have a sample array and I try to create a rule which will filter our either of the 2 items that are present in the array.
Sample array:
$d_c_arr = @('idata', 'quanthouse', 'reuters', 'bloomberg', 'fidelity', 'nasdaq')
The items that I want to filter out are 'idata
' and 'quanthouse
'.
The filtering rule should adapt to the situations where either both 'idata
' and 'quanthouse
' exist or only one of them is present in an array.
My attempt to define the rule:
$d_c_arr | Where-Object { $_ -notlike 'idata' -or $_ -notlike 'quanthouse' }
My expected output would be:
reuters
bloomberg
fidelity
nasdaq
However, the actual output is:
idata
quanthouse
reuters
bloomberg
fidelity
nasdaq
How to properly define the rule which would filter either of the 2 selected items in the array?
Upvotes: 0
Views: 1202