-
There are many date formatting options available to Powershell using the .net format specifiers. I will show some examples below, and you can look to the end of this post to see alla vailable format specifiers. To format a date to long date: "{0:D}" -f [DateTime]"7/14/2007" Produces...
-
The number formatting features available to Powershell though the dot net String.Format() function are a lot more exciting than the string formatting mentioned in my last post. I will give some examples here, and you may look at the end of this post for more formatting specifiers. To pad a number with...
-
Powershell uses the .Net string formatting features in String.Format. The only formatting functionality for a string is the alignment. To left align a string and pad to 40 chars, the following two lines produce the same result: [System.String]::Format("{0,-40}", "MTB rules") "...