PowerShell: True, False (boolean)
By Xah Lee. Date: . Last updated: .
True and False Representation
PowerShell $true $false
$true
or $false
are values in PowerShell to represent true and false.
- They are Automatic Variables.
Dotnet True False
- PowerShell is hosted in dotnet.
- In dotnet, boolean values are represented by
True
and False
. These are not valid in PowerShell, but PowerShell may print result using them.
Force to Boolean (Casting)
$x = 3
[bool] $x
$x = ""
[bool] $x
PowerShell. Boolean Related