Converting VBScript's Len Function
Definition: Returns the number of characters in a string or the number of bytes required to store a variable.
The “length” of a string is simply the number of characters contained in that string. In Windows PowerShell you can determine the length of a string by retrieving the value of the aptly-named Length property. In this example we stored the 26 letters of the English alphabet in a variable named $a, then assign the length of that string to the variable $b:
$a = "abcdefghijklmnopqrstuvwxyz" $b = $a.length
When you run this command and then echo back the value of $b you should get the following: