how to view all get-service properties on one screen

This topic contains 5 replies, has 4 voices, and was last updated by Profile photo of Bob McCoy Bob McCoy 6 months, 1 week ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #36748
    Profile photo of nick c
    nick c
    Participant

    I'm new to learning powershell and have been going through the powershell in a month of lunches book. I'm testing to see if there is a way to view all of the get-service properties on one screen. I've already tried gsv | select -property * | ft -autosize , but noticed that its missing the Status property that shows if a service is running or not.

    #36753
    Profile photo of H Man
    H Man
    Participant

    try this gsv | fl *

    #36755
    Profile photo of Michael Maher
    Michael Maher
    Participant

    I don't think you were far off in your code. As you're just testing out command capabilities I'd limit it to good old BITS

    Out-GridView might be easier on the eye too, for presentation of results often there is no right way and it boils down personal preference.

    gsv BITS | select -property * | ogv
    
    #36766
    Profile photo of nick c
    nick c
    Participant

    I tried gsv | fl * , it seems to have all of the properties, but is there any reason I can't get it to work in a table view instead of list view? I just think it's easier to look at.

    #36771
    Profile photo of Michael Maher
    Michael Maher
    Participant

    How about a custom table . . .

    $a = @{Expression={$_.Name};Label="Name";width=25}, 
    @{Expression={$_.DisplayName};Label="DisplayName";width=60}, 
    @{Expression={$_.CanStop};Label="Can Stop";width=40}
    
    Get-Service | Format-Table $a
    

    Second thoughts, this is easier

    gsv * | ft -AutoSize
    
    #36803
    Profile photo of Bob McCoy
    Bob McCoy
    Participant

    The short answer is, no. There are too many properties to list in table format in the console unless you make the console very wide.

    It's unclear here what you are ultimately trying to accomplish. If all you want to do is see all the properties and you don't like list view, then try the grid view.

    Get-Service | select -Property * | Out-GridView
Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.