PowerTip: Multiply Value in Variable and Store Results

Doctor Scripto

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

0 comments

Discussion is closed.

Feedback usabilla icon