I have an object coming from .Net that has a property of type SyncHashTable that can't be viewed w/o an exception being thrown.
One-line repro:
[HashTable]::Synchronized(@{})
Multi-line easier to play with repro:
$ht = new-object hashtable
$ht.add("foo", "bar")
$hts = [Hashtable]::Synchronized($ht)
$hts
The error:
format-default : Object reference not set to an instance of an object.
+ CategoryInfo : NotSpecified: (:) [format-default], NullReferenceException
+ FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.FormatDefaultCommand
Anyone have any insight into this?