when I have the filter hard coded it works fine. But when I use the variable $sqlfiler it does not filter anything
The contents of the $sqlfilter are
$.product -eq “Windows 10 for 32-bit Systems” -or $.product -eq “Windows Server 2016” -and $_.Sev -eq “Critical”
when I look at both the contents of the $sqlfilter and the hard coded one I can see a difference.
I have tried some tests from the console and the results are below :-
PS M:> $filepath = $csvtofilter
$myexcel = Import-CSV $filepath -header Product,kb,sev
Windows 10 for 32-bit Systems 4022727 (Security Update) Critical
Windows 10 for 32-bit Systems 4022727 (Security Update) Critical
Windows 10 for 32-bit Systems 4022727 (Security Update) Critical
Windows 10 for 32-bit Systems 4022727 (Security Update) Critical
Windows 10 for 32-bit Systems 4022727 (Security Update) Critical
Windows 10 for 32-bit Systems 4022727 (Security Update) Critical
Windows 10 for 32-bit Systems 4022727 (Security Update) Critical
PS M:> $myexcel | where-object $sqlfilter
PS M:>
If I put $myexcel | where-object {$sqlfilter}
It does not filter and returns the whole content of $myexcel