Syntax Question

This topic contains 2 replies, has 2 voices, and was last updated by  Lery 4 years, 3 months ago.

  • Author
    Posts
  • #4384

    Lery
    Participant

    I'm having a brain lapse here.  It has been a long day I guess.

    Get-Service -servicename 'bits' | select status

    Returns a column header Status with Running.

    I just want to return Running.  I need to drop the header.

    I know this works

    (Get-Service -servicename 'bits').status

    I cannot do that because I need to return a bunch of stuff.

  • #4385

    David Christian
    Participant

    What about this?

    Get-Service -servicename 'bits' | select  -expan status

     

  • #4393

    Lery
    Participant

    [quote=4385]What about this?

    PowerShell

    Get-Service -servicename 'bits' | select -expan status

    1

    Get-Service-servicename'bits'|select-expanstatus

    [/quote]

     

    Winner, winner, chicken dinner!  Thank you.  Like I said, long day.

You must be logged in to reply to this topic.