Without this change a dictionary $result object would be emptied if it is anything but a PSCustomObject. Now we also support Hashtables.