Returns the number of characters, including whitespace, of a string variable.
$[ScriptVariable]::length()
None
The following example illustrates the syntax for the length string method.
$str = "12345 6789"
$length = $str::length()
print($length)
10