Computer Library windows 2008 exchange server power shell security register

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()
        [...]


Make Decisions with Comparison and Logical Operators

1. Problem
You want to compare some data with other data and make a decision based on that comparison.
2. Solution
Use PowerShell’s logical operators to compare pieces of data and make decisions based on them.

Comparison operators:
-eq, -ne, -ge, -gt, -lt, -le, -like, -notlike, -match, -notmatch, -contains, -notcontains, -is, -isnot

Logical operators:
-and, -or, -xor, -not
For a detailed [...]