August 3rd, 2014

PowerTip: Use PowerShell to Display Square Root of Number

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to display the square root of a number.

Hey, Scripting Guy! Question How can I figure out the square root of a number when I am writing a Windows PowerShell script?

Hey, Scripting Guy! Answer Use the Sqrt static method from the System.Math class. This example obtains the square root of the number 9:

[math]::Sqrt(9)

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.