Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Comparing two PSCustomObject objects

$
0
0

Hello everyone,

I'm trying to find out if there is any simple method to compare two PsCustomObjects. Seems that Compare-Object doesn't support PsCustomObject and always reports that objects are the same. 

Steps to reproduce:

$A = [PsCustomObject]@{"A"=1; "B"=$True; "C"=$False}

$B = [PsCustomObject]@{"A"=1; "B"=$False; "C"=$False}

Compare-Object $A $B

Thanks,

Martin


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>