Get-WindowsFeature - Fancy organized Display Name output

Welcome Forums General PowerShell Q&A Get-WindowsFeature - Fancy organized Display Name output

This topic contains 1 reply, has 2 voices, and was last updated by

3 years, 3 months ago.

  • Author
  • #45291

    Topics: 3
    Replies: 27
    Points: 0
    Rank: Member

    This might not be possible, but I really dislike when you run a command like below... and get nice looking tree-structured looking results for 'Display Name' because of some trickery in the background built-into the command.

    Get-WindowsFeature | Where-Object { $_.Installed -match "True" }

    Now, I know 'Display Name' is not a valid property/column/etc... but that's how it's displayed... only it's being cut off because the length of the text is too long. But if you JUST display the 'DisplayName', it's no longer formatted in a tree-like structure with X's. I literally want to display the Display Name only, in the console, with the nice looking structure showing what features are sub-items of another feature, but I don't see a way to do that.

    Any thoughts there? Am i missing some obvious formatting option? I use the data returned in all sorts of scripts, but in this ONE instance, I want to actually display it to a user and i thought i'd make it look nice like that instead of just a static list.

    Thanks in advance


  • #45297

    Topics: 13
    Replies: 4872
    Points: 1,844
    Helping HandTeam Member
    Rank: Community Hero

    That's done by a custom view, in a PS1XML file stored with the module. Any manual formatting you specify negates the view. To do what you want, you'd have to make an overriding view. We cover those in "PowerShell In Depth," actually.

The topic ‘Get-WindowsFeature - Fancy organized Display Name output’ is closed to new replies.