i have 2 arrays. Both have a property for the file size, but the property name in the first array is "SizeInByte" and in the other array it is called "Length". Is is possible to use compare-object to compare the two arrays based on the file size ? So far i haven`t found a way to do this :(
Pipe one array to the Add-Member cmdlet and create a SizeInByte alias property for the Length property, then compare the two arrays by the same property name.
$LengthArr = $LengthArr | Add-Member -MemberType AliasProperty -Name SizeInByte -Value Length -PassThru
Compare-Object $LengthArr $SizeInByteArr -Property SizeInByte
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With