Skip to content

Instantly share code, notes, and snippets.

@Purp1eW0lf
Created February 15, 2022 23:20
Show Gist options
  • Save Purp1eW0lf/edf78702683d292e773cc9ac168897a9 to your computer and use it in GitHub Desktop.
Save Purp1eW0lf/edf78702683d292e773cc9ac168897a9 to your computer and use it in GitHub Desktop.
get-wsmaninstance -resourceuri shell -enumerate |
select Name, State, Owner, ClientIP, ProcessID, MemoryUsed,
@{Name = "ShellRunTime"; Expression = {[System.Xml.XmlConvert]::ToTimeSpan($_.ShellRunTime)}},
@{Name = "ShellInactivity"; Expression = {[System.Xml.XmlConvert]::ToTimeSpan($_.ShellInactivity)}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment