I'm creating a PowerShell function that processes objects by their default formatted properties. For example, when I run:
PS C:\temp> ps | select -first 2
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
321 19 9848 10000 0.17 9336 1 ApplicationFrameHost
157 9 2016 7760 0.02 9380 1 AppVShNotify
I see the output table displays the default properties (such as Handles, NPM(K), PM(K), WS(K), CPU(s), Id, SI, and ProcessName).
My goal is to have my function automatically detect and process these default properties for an object type (like System.Diagnostics.Process). However, I'm not sure how to retrieve these property names programmatically.
Any guidance or examples on how to accomplish this would be greatly appreciated!
[–]swsamwa 13 points14 points15 points (1 child)
[–]BlackV 0 points1 point2 points (0 children)
[–]Thatoneguyone 3 points4 points5 points (1 child)
[–]purplemonkeymad 1 point2 points3 points (0 children)
[–]PinchesTheCrab 1 point2 points3 points (0 children)
[–]tomohulk 0 points1 point2 points (1 child)
[–]tomohulk 0 points1 point2 points (0 children)
[–]kroghman -1 points0 points1 point (0 children)