Trims any leading and trailing whitespace from the specified variable.
$[ScriptVariable]::trim()
None
The following example illustrates the syntax for the trim string method:
$str = " first string "
$str::trim()
print($str)
first string