title: New-TimeSpan cmdlet in powershell
body: <p>How can i use New-Timespan cmdlet to calculate the total time taken for script execution.I tried a sample like this.</p>
  
  <pre><code>$val=Get-Date
  $start=New-TimeSpan -Start $val
  $val2=Get-Date
  $end=New-TimeSpan -End $val2
  $diff=New-TimeSpan -Start $start -End $end
  </code></pre>
  
  <p>But ended up with following error: New-TimeSpan : Cannot bind parameter 'Start'. Cannot convert the "00:00:08.7110000" value of type "System.TimeSpan" to
  type "System.DateTime".</p>