Good day, it´s a little hard to explain what I want to do, for that reason I did added code what I´m looking for.
$IDFilterList = @("1" , "2", "3", "4", "5", "6", "7", "8", "9")
if ($file.Name.Contains("SomeStuff")) {
$ImportendCollection += $Result |
Where-Object { ($_.Level -Match 1) -or ($_.Level -Match 2) -or ($_.Level -Match 3) |
**** Where-Object { foreach ($id in $IDFilterList) {($_.ID -Match $id)}} |
Group-Object -Property id, LevelDisplayName, LogName -NoElement |
Sort-Object -Property count -Descending
}
I know that this code isn´t correct in the line with the "stars", but it should explain what i want to do. How must this line be look like correctly?
Where-Object { foreach ($id in $IDFilterList) {($_.ID -Match $id)}} |
Thanks for your help.
$IDFilterListcontains the value of$_.ID?$file,$ImportendCollection,$Resultetc. are about, this would be very hard to answer. Please edit your question and tell us what it all means-match:Where-Object {$_.Level -in 1,2,3 -and $_.ID -in $IDFilterList }