problem conditional formatting with 'ConvertTo-EnhancedHTMLFragment'

Welcome Forums General PowerShell Q&A problem conditional formatting with 'ConvertTo-EnhancedHTMLFragment'

This topic contains 3 replies, has 2 voices, and was last updated by

 
Keymaster
6 months, 2 weeks ago.

  • Author
    Posts
  • #99999

    Participant
    Points: 16
    Rank: Member

    Hi,

    Not sure if anyone else has run into this one but I'll give it a shot –

    I really like the 'ConvertTo-EnhancedHTMLFragment' cmdlet.
    However, when I use it, It changes the order of my selected properties.
    See my code below:

     $frag1 = Get-ChildItem -Path IIS:\AppPools | 
                         Select-Object -Property @{e={$_.name};l="App Pool Name"},
                                                 @{e={$_.state};l="State"},
                                                 @{e={$_.ManagedRuntimeVersion};l=".NET Runtime Version"},
                                                 @{e={$_.ManagedPipelineMode};l="Pipeline Mode"},
                                                 @{e={$_.processModel.username};l="Svc Account"}                
                
                $frag1 | ConvertTo-EnhancedHTMLFragment -PreContent $precontent -MakeHiddenSection 

    Note: When I use the ConvertTo-HTML cmdlet instead, it leaves the order of my properties alone.
    Has anyone run into this one? If so, any suggestions would be helpful.
    I really like the EnhancedHTML2 cmdlets and would like to stick with them.

    Thanks,

  • #100002

    Participant
    Points: 16
    Rank: Member

    Sorry, meant 'Calculated Properties'
    not 'Conditional Formatting.'

    Long day 🙂

  • #100009

    Participant
    Points: 16
    Rank: Member

    Well, nevermind.
    I actually read the help on ConvertTo-EnhancedHTMLFragment
    and discovered the -Properties parameter.

    Sorry to waste your time.
    Nothing to see here. 🙂

  • #100024

    Keymaster
    Points: 1,624
    Helping HandTeam Member
    Rank: Community Hero

    Keep in mind that the dynamic table JavaScript will reorder things on its own. I can't alter that.

The topic ‘problem conditional formatting with 'ConvertTo-EnhancedHTMLFragment'’ is closed to new replies.