Probably the best way to handle booleans is with the [string is true $bool]
or [string is false $bool] command. (check the docs. you might want a -strict
in there depending on your needs)
This command will accept the words true or false, the letters t or f, or the
numbers 1 or 0. The command always returns 1 or 0.