i am trying to figure out how i can search a value in an array that is in a pscustomobject.
$global:RuleSet+= [pscustomobject][ordered]@{ RuName="NSMS" ;
Agent=("ABC",
"DFG",
"HIJ")}
$search = "ABC"
$myRuleSet = $RuleSet | Where-Object { $search -contains $_.Agent }
This was my attempt to solve the problem, but it dosn't seem to work that way. Can someone please explain to my how this could or should be done?