I have an object coming from .Net that has a property of type SyncHashTable that cannot be viewed without an exception being thrown.
Single line view:
[HashTable]::Synchronized(@{})
Multi-line is easier to play with playback:
$ht = new-object hashtable
$ht.add("foo", "bar")
$hts = [Hashtable]::Synchronized($ht)
$hts
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
Can anyone figure this out?
source
share