R

Do I miss something (see the code and comments below)? I am with V2

CTP3, do other versions work in the same way?

# Operator -not should get True for whatever -eq 0 gets True

$ToBe = 0

$ToBe -eq 0 # True, OK

-not $ToBe # True, OK

$ToBe = (Get-Variable ToBe).Options

$ToBe -eq 0 # True, OK

-not $ToBe # False, WOW, leads to subtle bugs, difficult to find

<#

Actual output:

True

True

True

False

Expected output:

True

True

True

True

#>

# How do you like this: both conditions are true

if ($ToBe -eq 0) {

"This is true, OK"

}

if ($ToBe) {

"And this is true, WOW"

}

<#

Output:

This is true, OK

And this is true, WOW

#>

CTP3, do other versions work in the same way?

# Operator -not should get True for whatever -eq 0 gets True

$ToBe = 0

$ToBe -eq 0 # True, OK

-not $ToBe # True, OK

$ToBe = (Get-Variable ToBe).Options

$ToBe -eq 0 # True, OK

-not $ToBe # False, WOW, leads to subtle bugs, difficult to find

<#

Actual output:

True

True

True

False

Expected output:

True

True

True

True

#>

# How do you like this: both conditions are true

if ($ToBe -eq 0) {

"This is true, OK"

}

if ($ToBe) {

"And this is true, WOW"

}

<#

Output:

This is true, OK

And this is true, WOW

#>