Format-List apparently has a string parameter named "view", as can be seen here. What does it do, and how does it work? I cannot find any documentation beyond "The name of an alternate format or 'view.'"
The '-View' parameter on the various Format-* cmdlets allows you to get various different "views" or formattings of the data e.g.:
PS> Get-Process
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
672 56 272684 220692 975 141.45 8480 powershell
692 34 47184 60156 234 23.73 17048 powershell
751 82 217624 162780 1047 157.73 13336 powershell_ise
versus
PS> Get-Process | Format-Table -View StartTime
StartTime.ToShortDateString(): 1/14/2013
ProcessName Id HandleCount WorkingSet
----------- -- ----------- ----------
powershell 8480 672 225988608
StartTime.ToShortDateString(): 2/6/2013
ProcessName Id HandleCount WorkingSet
----------- -- ----------- ----------
powershell 17048 624 92418048
StartTime.ToShortDateString(): 1/17/2013
ProcessName Id HandleCount WorkingSet
----------- -- ----------- ----------
powershell_ise 13336 771 166686720
As for determining which commands support alternate views, you can usually find such info in the docs. Here's an excerpt from the Get-Process help:
You can also use the built-in alternate views of the processes available with Format-Table, such as "StartTime" and "Priority", and you can design your own views. For more information, see T:Microsoft.PowerShell.Commands.Format-Table.
The PowerShell Community Extensions also includes a command called Get-ViewDefinition that can get this info when the docs aren't available (or of much help in this regards.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With