We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Did you know, that in #Powershell the ++ operator does not return a value per se? Neither ++$x nor $x++ will return anything!
++
++$x
$x++
However, if you put them in a calculation, or any other block that evaluates the whole statement again, you will get the expected results!
$x = 1; $x # -> 1 $x = 1; ++$x # -> nothing $x = 1; $x++ # -> nothing $x = 1; 1 + $x++ # -> 2 $x = 1; 1 + ++$x # -> 3 $x = 1; + $x++ # -> 1 $x = 1; + ++$x # -> 2 $x = 1; ($x++) # -> 1 $x = 1; (++$x) # -> 2