operator precedence and cmdlet argument

by Sep 10, 2011

I'm very surprise that the following instruction generates an error:

Start-Sleep -Milliseconds 400*2

the error is:

Cannot bind parameter 'Milliseconds'. Cannot convert value "400*2" to type "System.In
t32". Error: "Input string was not in a correct format."

 

In the other hand, the following statement is accepted by powershell:

Start-Sleep -Milliseconds (400*2)

I don't understand why the first syntax is rejected.

Any idea ?

thanks