How do I expand values returned from cmdlet?

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of GS GS 2 years, 7 months ago.

  • Author
    Posts
  • #14898
    Profile photo of GS
    GS
    Participant

    Hello,

    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

    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
    Profile photo of Robert Westerlund
    Robert Westerlund
    Participant

    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
    Profile photo of GS
    GS
    Participant

    Thanks,that's was it.

You must be logged in to reply to this topic.