How do I expand values returned from cmdlet?

This topic contains 2 replies, has 2 voices, and was last updated by  GS 4 years, 1 month ago.

  • Author
  • #14898



    I'm trying to output to screen NoteProperty value which always truncated. Code is below. I'm reading values of VisibleCmdLets property of PSSessionConfiguration. How I can output entire string without truncating? I tried FL and FT but all of them are being truncated.

    PS C:\Windows\system32> Get-PSSessionConfiguration GOC | Select VisibleCmdlets

    {ARR-*, Out-*, Get-Command, Measure-object...}

    PS C:\Windows\system32> Get-PSSessionConfiguration GOC | Select VisibleCmdlets | gm

    TypeName: Selected.System.Object

    Name MemberType Definition
    —- ———- ———-
    Equals Method bool Equals(System.Object obj)
    GetHashCode Method int GetHashCode()
    GetType Method type GetType()
    ToString Method string ToString()
    VisibleCmdlets NoteProperty System.Object[] VisibleCmdlets=System.Object[]

  • #14901

    Robert Westerlund

    I believe the title of your question is actually the answer to your question. The Select-Object cmdlet has a parameter named -ExpandProperty, which is likely what you want. Try running:

    Get-PSSessionConfiguration GOC | Select -ExpandProperty VisibleCmdlets

    Let us know how it went.

  • #14902


    Thanks,that's was it.

You must be logged in to reply to this topic.