Computer Library windows 2008 exchange server power shell security register

Convert Numbers Between Bases

1. Problem
You want to convert a number to a different base.
2. Solution
The PowerShell scripting language allows you to enter both decimal and hexadecimal numbers directly. It does not natively support other number bases, but its support for interaction with the .NET Framework enables conversion both to and from binary, octal, decimal, and hexadecimal.
To convert a [...]


Perform Complex Arithmetic

1. Problem
You want to use PowerShell to calculate more complex or advanced mathematical results.
2. Solution
PowerShell supports more advanced mathematical tasks primarily through its support for the System.Math class in the .NET Framework.
To find the absolute value of a number, use the [Math]::Abs() method:
        PS >[Math]::Abs(-10.6)
        10.6

To find the power (such as the square or the [...]


Convert a String to Upper/Lowercase

1. Problem
You want to convert a string to uppercase or lowercase.
2. Solution
Use the ToUpper() and ToLower() methods of the string to convert it to uppercase and lowercase, respectively.
To convert a string to uppercase, use the ToUpper() method:
        PS >”Hello World”.ToUpper()
        HELLO WORLD

To convert a string to lowercase, use the ToLower() method:
        PS >”Hello World”.ToLower()
        [...]