I am still very new to the concept of objects and can't wrap my head around this:
PS C:\Windows\system32> $obj1 = New-Object psobject
$obj1 | Add-Member -NotePropertyName Whatever -NotePropertyValue "blah"
$obj2 = New-Object psobject
$obj2 | Add-Member -NotePropertyName Whatever -NotePropertyValue "blih blah"
$obj2 | %{$obj1 -match $_}
False
Ok so it seems like I can't use the -match operator on a PSCustomObject System.Object apparently..because the string "blah" is present in both objects.
so if I try :
PS C:\Windows\system32> $arr1 = @("blah")
$arr2 = @("blih blah")
$arr1 | %{$arr2 -match $_}
blih blah
Then it works! So what? Do I need to convert any PSCustomObject System.Object into an Object System.Array before I can use operators like "-match" ??
Surely, there must be a quick and straight forward way to do this directly from a PSCustomObject System.Object, no?
All I want to do is parse 2 PSCustomObject System.Object and check if the values of the first one are present in the 2nd one in a way or another (full match, partial match etc..)
Thanks very much!