I was trying to test a returned object's type but I couldn't make it work in a good way.
$obj = @()
$obj | should be [Array]
gives
Expected that (actual) () be ([Array]).
I can, of course, do:
$obj -is [Array] | should be $true
but when it's not true I get
Expected that (actual) (False) be (True)
rather than the actual type. Is there a way to write it such that I get the type back when it fails?