locked
Remove colums/title in Select-Object result RRS feed

  • Question

  • Hi Experts,

    Just want to ask on for example, I have this simple script like this:

    Get-Process | Select-Object name,id

    Name             Id
    ----             --
    AcPrfMgrSvc     2284
    AcSvc         3160
    armsvc     2316

    If I want to return only the result without the "Title"

    AcPrfMgrSvc     2284
    AcSvc         3160
    armsvc     2316

    Is this something can be done through select object?

    Thanks!

    Reynald


    None

    Tuesday, October 28, 2014 5:37 PM

Answers

  • Not through Select-Object, but you can choose not to display the table headers in Format-Table:

    Get-Process | Select-Object name,id | Format-Table -HideTableHeaders


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

    • Marked as answer by reynald13 Tuesday, October 28, 2014 6:35 PM
    Tuesday, October 28, 2014 5:43 PM

All replies

  • Not through Select-Object, but you can choose not to display the table headers in Format-Table:

    Get-Process | Select-Object name,id | Format-Table -HideTableHeaders


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

    • Marked as answer by reynald13 Tuesday, October 28, 2014 6:35 PM
    Tuesday, October 28, 2014 5:43 PM
  • That did the job! thanks mjolinor!

    None

    Tuesday, October 28, 2014 6:35 PM
  • Welcome!

    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

    Tuesday, October 28, 2014 6:51 PM