Automatic variables have booleans for True and False as $true and $false but you can get similar results using the logical not operator ! and the integers 0 and 1( or any non-zero integer.)
PS C:\Users\matt> !1
False
PS C:\Users\matt> !0
True
Near all PowerShell statementsexpressions can be evaluated as booleans. So as long as you are aware of how certain data is evaluated you can get booleans and never need to explicitly cast them. Be aware of the LHS value when doing these.
- Integer 0 is false and non-zero integers are evaluated to true.
- non-zero length strings are true and empty or null (and nulls themselves) strings are false.
There are other examples but you can easily test by doing a cast
PS C:\Users\matt> [bool]@(0)
False