Tutorial by Examples

Use existing .NET classes instantly with PowerShell by using [class]::Method(args): PS C:\> [guid]::NewGuid() Guid ---- 8874a185-64be-43ed-a64c-d2fe4b6e31bc Similarly, in PowerShell 5+ you may use the New-Guid cmdlet: PS C:\> New-Guid Guid ---- 8874a185-64be-43ed-a64c-d2fe4b6e31...
You can use the .Net Math class to do calculations ([System.Math]) If you want to know which methods are available you can use: [System.Math] | Get-Member -Static -MemberType Methods Here are some examples how to use the Math class: PS C:\> [System.Math]::Floor(9.42) 9 PS C:\> [System....
By Assembly Name, add library Add-Type -AssemblyName "System.Math" or by file path: Add-Type -Path "D:\Libs\CustomMath.dll" To Use added type: [CustomMath.NameSpace]::Method(param1, $variableParam, [int]castMeAsIntParam)

Page 1 of 1