I'm trying to determine how to exclude values from an array based on a CSV file. This is the best option I have so far:
$arrIgnore = import-csv "ignore.csv"
foreach($objIgnore in $arrIgnore){
$objAll = $objAll | where {$_.Name -ne $objIgnore.Name}
}
This doesn't filter out a single item from the array. If I write out the problem with the values in strings:
$objAll = $objAll | where {$_.Name -ne "value1"}
$objAll = $objAll | where {$_.Name -ne "value2"}
It works correctly. I'm sure I'm making a stupid mistake but I can't figure it out. :-)