Show content of hashtable when Pester test case fails
问题 Problem When a Hashtable is used as input for Should , Pester outputs only the typename instead of the content: Describe 'test' { It 'test case' { $ht = @{ foo = 21; bar = 42 } $ht | Should -BeNullOrEmpty } } Output: Expected $null or empty, but got @(System.Collections.Hashtable). Expected output like: Expected $null or empty, but got @{ foo = 21; bar = 42 }. Cause Looking at Pester source, the test input is formatted by private function Format-Nicely , which just casts to String if the