4 ms·
I used “true” instead of “$True” in a power shell script. It didn’t error. It didn’t warn. It just evaluated to false. So doesn’t behave like a strongly typed
by diroussel 6y ago
I used “true” instead of “$True” in a power shell script. It didn’t error. It didn’t warn. It just evaluated to false.
So doesn’t behave like a strongly typed language to me.
- majkinetor 6y agoRTFM - if you don't specify type, it is infered. [bool] $x = "true" MetadataError: Cannot convert value "System.String" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0.