Just for illustration…
$obj1 = [PSCustomObject]@{
Prop1 = '<string>'
Prop2 = [PSCustomObject]@{
Sub1 = '<string>'
Sub2 = '<string>'
}
Prop3 = '<int>'
Prop4 = [PSCustomObject]@{
Sub1 = '<int>'
Sub2 = '<string>'
}
}
$obj1
Prop1 : <string>
Prop2 : @{Sub1=<string>; Sub2=<string>}
Prop3 : <int>
Prop4 : @{Sub1=<int>; Sub2=<string>}
$obj2 = [PSCustomObject]@{
Prop1 = 'Value1'
Prop2 = [PSCustomObject]@{
Sub1 = 'SubValue1'
Sub2 = 'SubValue2'
Sub3 = 'SubValue3'
Sub4 = 'SubValue4'
Sub5 = 'SubValue5'
}
Prop3 = '111'
Prop4 = [PSCustomObject]@{
Sub1 = '222'
Sub2 = 'SubValue2'
Sub3 = 'SubValue3'
Sub4 = '444'
}
Prop5 = 'Value5'
}
$obj2
Prop1 : Value1
Prop2 : @{Sub1=SubValue1; Sub2=SubValue2; Sub3=SubValue3; Sub4=SubValue4; Sub5=SubValue5}
Prop3 : 111
Prop4 : @{Sub1=222; Sub2=SubValue2; Sub3=SubValue3; Sub4=444}
Prop5 : Value5
Any idea, how can I get the values from $obj2 to an extent where the properties are available only in $obj1??
Thank you,
Kiran.