#requires -version 2.0 Param ( [Parameter(Position=0,Mandatory=$True,HelpMessage="Enter a process name like lsass")] [ValidateNotNullorEmpty()] [string]$Name, [Parameter(Position=1)] [ValidateNotNullorEmpty()] [string]$Computername=$env:computername ) Try { Get-Process -Name $name -ComputerName $computername -errorAction "Stop" | Select *, @{Name="Runtime";Expression={(Get-Date)-$_.StartTime}} } Catch { Write-Warning $_.Exception.Message }