Creating dynamic filter for where clause

I am trying to build a dynamic filter for a where clause based on what checkboxes have been selected on a form
using the following code
If ($checkBox1.Checked -eq $True)
{write-host “Checkbox 1 selected”
$filterpr = “$.product -eq Windows 10 for 32-bit Systems"
If ($checkBox2.Checked -eq $True)
{write-host “Checkbox 2 selected”
$filterpr = "$
.product -eq Windows Server 2016”
when I write-host instead of $filterpr being set to either $.product -eq Windows 10 for 32-bit System or $.product -eq Windows Server 2016 it is set to System.Windows.Forms.MouseEventArgs.product -eq Windows Serve
r 2016

So 2 questions

  1. how do I get the $_ into the variable and what would you suggest if the best way of adding a -or in the middle if both check boxes were selected i.e. the filter should be Where-object{$.product -eq “Windows 10 for 32-bit Systems” -or $.product -eq “Windows Server 2016” -and $_.Sev -eq “Critical”}

Ok, I have spotted the issue with the first bit. I had forgotten the grave ` character in front of the $ :slight_smile: I still have not come up with an elegant way of putting an -or between the 2 strings if 2 or more check boxes have been selected.