#PowerShell mathematical calculations


The key to unlocking the ability of Windows PowerShell to create useful formulas is to leverage the static methods from the system.math class. You can easily see them by using the Get-Member cmdlet, as shown here:

PS C:\> [math] | Get-Member -Static | Format-Table name, membertype -AutoSize

Name            MemberType
—-            ———-
Abs                 Method
Acos                Method
Asin                Method
Atan                Method
Atan2               Method
BigMul              Method
Ceiling             Method
Cos                 Method
Cosh                Method
DivRem              Method
Equals              Method
Exp                 Method
Floor               Method
IEEERemainder       Method
Log                 Method
Log10               Method
Max                 Method
Min                 Method
Pow                 Method
ReferenceEquals     Method
Round               Method
Sign                Method
Sin                 Method
Sinh                Method
Sqrt                Method
Tan                 Method
Tanh                Method
Truncate            Method
E                 Property
PI                Property

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: