[Superseded by #6466]
#3671 discussed the issue with respect to [pscustomobject] instances, for which a fix was attempted in #5756 (but the fix is not in v6.0.2 - @iSazonov, should it be?).
However, there are instances of other types where the problem persists.
It would be good to clarity on the generic issue, so that it can be fixed for any (current and future) type.
Steps to reproduce
([System.Data.DataTable]::new()).Count
([pscustomobject] @{}).Count
Expected behavior
0 # because [System.Data.DataTable] is treated as an *enumerable* - see @stknohg's comment below.
1
Actual behavior
The output is $null, because there is no .Count property.
Environment data
PowerShell Core v6.0.2 on macOS 10.13.3
PowerShell Core v6.0.2 on Ubuntu 16.04.3 LTS
PowerShell Core v6.0.2 on Microsoft Windows 10 Pro (64-bit; v10.0.15063)
Windows PowerShell v5.1.15063.674 on Microsoft Windows 10 Pro (64-bit; v10.0.15063)
[Superseded by #6466]
#3671 discussed the issue with respect to
[pscustomobject]instances, for which a fix was attempted in #5756 (but the fix is not in v6.0.2 - @iSazonov, should it be?).However, there are instances of other types where the problem persists.
It would be good to clarity on the generic issue, so that it can be fixed for any (current and future) type.
Steps to reproduce
Expected behavior
Actual behavior
The output is
$null, because there is no.Countproperty.Environment data