Pages

Monday, June 8, 2009

Expression in PowerShell

Additional capability of PowerShell is expressions.

Let’s look at the simple example

PS H:\> (150*15)/20
112.5
PS H:\>

One thing to note here is PowerShell displayes the values immediately. Where in other scripting languages you need to use either variable or use special commands to print the value.

You can also store the output of this expression into a variable.

PS H:\> $Result = (150*15)/20
PS H:\> $Result
112.5
PS H:\>

No comments: