Variables, Types and Collections: [type] Casts, Arrays, Hashtables, PSCustomObject, Splatting and Strings
In PowerShell the result of a comparison depends on the type of the value on the left, and Import-Csv reads every column as a string, so data has to be converted to real types up front. Building a publisher report from Bookstore's book CSV, we cover putting $null on the left, arrays and +=, List, hashtables, PSCustomObject, splatting, strings, number and date traps under a Turkish culture, and how a [decimal] cast gives a different result on PowerShell 7.7 because of .NET 11.
15 Nov 2026
·
18 min
·
7