Select-Object to use property and expand property

This topic contains 1 reply, has 2 voices, and was last updated by  Dave Wyatt 3 years, 8 months ago.

  • Author
    Posts
  • #14502

    Hi,

    I have a small issue, how to use both property and expand property at the same time. Though they are in same parameter set, i am unable to use it.

    Select-Object [[-Property] ] [-ExcludeProperty ] [-ExpandProperty ] [-First ] [-In
    putObject ] [-Last ] [-Skip ] [-Unique] []

    Example: PS C:\Users\kvrpakkiragari> Get-Process powershell | Select-Object -Property * -ExpandProperty StartInfo

    Verb :
    Arguments :
    CreateNoWindow : False
    EnvironmentVariables : {temp, processor_revision, processor_level, logonserver...}
    RedirectStandardInput : False
    RedirectStandardOutput : False
    RedirectStandardError : False
    StandardErrorEncoding :
    StandardOutputEncoding :
    UseShellExecute : True
    Verbs : {}
    UserName :
    Password :
    Domain :
    LoadUserProfile : False
    FileName :
    WorkingDirectory :
    ErrorDialog : False
    ErrorDialogParentHandle : 0
    WindowStyle : Normal

    getting output of only expand property.

  • #14503

    Dave Wyatt
    Moderator

    I can reproduce this in PowerShell 2.0, but in 4.0 it works fine. Not sure about 3.0; I don't have a system handy that hasn't been upgraded to 4.0 right now.

You must be logged in to reply to this topic.