Objects with no ‘.Count’ Property – use of @() (array subexpression operator) vs. [Array] cast

In PSv3+, with its unified handling of scalars and collections, any object – even $null – should have a .Count property (and, with the exception of $null, should support indexing with [0]). Any occurrence of an object not supporting the above should be considered a bug; for instance: Using this intrinsic (engine-supplied) .Count property unexpectedly … Read more

What Library for Powershell 6 contains the get-wmiobject command?

Gert Jan Kraaijeveld’s helpful answer offers a solution for cmdlets that truly are available only in Windows PowerShell (not also in PowerShell [Core] 6+). In this particular case, however, as Lee_Daily notes in a comment, you can use the Get-CimInstance cmdlet, which is available in PowerShell [Core] 6+ too: Get-CimInstance CIM_Product | Select-Object Name, PackageCache … Read more