PowerTip: Use Parentheses to Override Operator Precedence
Summary: Use parentheses to override operator precedence in Windows PowerShell.
How can I ensure that a math expression that keeps returning incorrect information will work properly in
In Windows PowerShell (as in other languages), math operators have a precedence. Therefore, division
comes before addition. If you want to override this behavior, group with parentheses, for example:
PS C:\> 2 + 9 / 3
(2 + 9)/3