3
J'ai un objet provenant de .Net qui a une propriété de type SyncHashTable qui ne peut pas être affichée sans qu'une exception soit levée.Sync'd Hashtable n'est pas compatible PowerShell. Essayez: [HashTable] :: Synchronized (@ {})
repro une ligne:
[HashTable]::Synchronized(@{})
multi-ligne plus facile à jouer avec repro:
$ht = new-object hashtable
$ht.add("foo", "bar")
$hts = [Hashtable]::Synchronized($ht)
$hts
L'erreur:
format-default : Object reference not set to an instance of an object.
+ CategoryInfo : NotSpecified: (:) [format-default], NullReferenceException
+ FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.FormatDefaultCommand
Quelqu'un a une idée de ce?
BTW, si vous voulez, votez sur le bogue ici - https://connect.microsoft.com/PowerShell/feedback/details/615449/display-of-synchronized-hashtable-generates-error –