- This topic has 2 replies, 2 voices, and was last updated 2 weeks, 6 days ago by
November 11, 2020 at 10:04 am #270706ParticipantTopics: 1Replies: 1Points: 14Rank: Member
I am brand new to this and is learning the command Get-Process | ft name, cpu, starttime, Company,
If i run a “get-process” I get the headlines Status Name DisplayName
It is however possible to run
Get-Process | ft name, cpu, starttime, Company, path -wrap -GroupBy Company
and I see the headlines mentioned in the command (name, cpu, starttime etc)
How am i supposed to know, that Get-Process contains the possibility of showing the added headlines?
I would expect a command like “Get-Process -detail” but i cannot find a command like that.
I hope im not to unclear.
November 11, 2020 at 10:54 am #270712ParticipantTopics: 16Replies: 1855Points: 3,568Rank: Community Hero
When you pipe to Format-Table (ft), you’re piping all properties and telling Format-Table you only want to see select properties. Be with Format-Table, it is ONLY made to display formatted for the shell. No data is passed beyond most Format-* commands, so you cannot do Get-Process | Format-Table | Stop-Process, one of Powershell’s Gotchas (see the ebook in the Free Resources). Here is a basic answer to your question:PowerShell12345678910111213141516171819#Some commands have a lot of information, so they show default properties#In this case, even the column names are aliases to try to fit the most needed#information on the screen in a table formatGet-Process#The first thing you can try is simply using Select-Object to override the formatting#and showing all propertiesGet-Process | Select-Object -Property *#To show all properties\methods\etc. for a command, use Get-MemberGet-Process | Get-Member -Force#Another note is commands like Get-ADUser. There is a -Properties parameter. By default, it only#shows a couple of attributes. You need to specify * for all properties and anytime you want another property#outside of the defaults, for instance if you wanted default properties and mail, it would be -Property Mail. If#you see a Property parameter, the command gives you the ability to manipulate what is returned as there is an impact to#performance and time the more you pull. Get-Process is simply hiding properties to make it simple and easy to read.Get-ADUser -Property Mail | Select * # would show defaults + mailGet-ADUser -Property * | Select * #would show ALL properties in Active Directory for users
November 11, 2020 at 11:03 am #270715ParticipantTopics: 1Replies: 1Points: 14Rank: Member
Thank you very much Rob.
Imagine all people being that helpful. I hope I will be able to pass on the kindness sometime.
- You must be logged in to reply to this topic.