function unchunk-PSObject {param([Parameter(Mandatory = $true)]$PSobject) $intermediateprop = @() #create an intermediate array to store our properties that we will comb out from objectchunks. foreach ($chunk in $PSobject) #for each of the two chunks (or more), parse each property in the chunk. (chunk.psobject.properties) { foreach ($property in $chunk.psobject.properties){$intermediateprop += $property} #insert each property into an intermediate table. } $viewobjects = @() $unchunkedobject = new-object pscustomobject #instantiate a new $object for return from the base function. foreach ($property in $intermediateprop) #pull out the properties we care about and insert them with add-member into the new object. { add-member -inputobject $unchunkedobject -membertype $property.membertype -name $property.name -value $property.value -force } $unchunkedobject }