July 4th, 2015

PowerTip: Multiply Value in Variable and Store Results

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to multiply the value stored in a variable and store the results.

Hey, Scripting Guy! Question How can I use Windows PowerShell to multiply the value of a variable and store the results in the same variable?

Hey, Scripting Guy! Answer Use the *= operator, for example:

PS C:> $a = 2

PS C:> $a *= 3

PS C:> $a

6

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.