title: Trim is not doing it
body: <p>I am building a script that will <code>Test-Connection</code> the local gateway and a website.  To get the active gateway I use:</p>
  
  <pre><code>$GateWay = (Get-wmiObject Win32_networkAdapterConfiguration | ?{$_.IPEnabled}).DefaultIPGateway
  </code></pre>
  
  <p>This works fine, but it adds two spaces to the outcome.  I have used <code>Trim()</code> to get them away, but using <code>.length</code>, that does not do the job and it breaks in the next lines of my script.  So, stuck here..</p>
  
  <p>Here the code I use to test:</p>
  
  <pre><code>Clear-host
  $Gateway = [String](Get-wmiObject Win32_networkAdapterConfiguration | ?{$_.IPEnabled}).DefaultIPGateway
  $GateWay.Length
  $GateWay.Trim()
  $GateWay.Length
  </code></pre>