Here is a nice a nice function in Powershell to Convert a String to Uppercase or Lowercase. If your looking to output important information in uppercase or convert a returned variable into lowercase we can use the built in ToUpper() or ToLower() methods.
To convert a string to Uppercase we will use the ToUpper() method.
To convert a string to Lowercase we will use the ToLower() method.
As you can see these methods are very easy to use. We can manipulate these a lot more as they are fully featured .NET objects they support many functions.
For example we can capitalize the first letter.
$string = "hello world"
$newstring = $string.Substring(0,1).ToUpper() +
There isn’t much else to cover on the ToUpper() and ToLower() methods. They are both very useful methods and can be incorporated into many of your powershell scripts.
The post Powershell Convert String to upper or lower case appeared first on MickWalton.com.