To find out how long your PowerShell session has been running, try this code snippet:
((((Get-Date)-(Get-Process -id $pid).starttime) -as [string]) -split '\.')[0]
To find out how long your PowerShell session has been running, try this code snippet:
((((Get-Date)-(Get-Process -id $pid).starttime) -as [string]) -split '\.')[0]