Project

PSWriteHTML

PSWriteHTML is an open-source PowerShell project with packages, release history, and working documentation.

Stars1015
Forks112
Open issues54
PowerShell Gallery downloads7576901
Releasev1.41.0
Language: PowerShell Updated: 2026-08-10T20:00:10.0000000+00:00

Curated Examples

Test Allcommands Density

Source-owned example maintained with PSWriteHTML.

Import-Module "$PSScriptRoot\..\..\PSWriteHTML.psd1" -Force

New-HTML {
    New-HTMLSection -HeaderText "๐Ÿงช Testing Density Parameter Across All Commands" -Wrap wrap {

        New-HTMLText -Text @"
<h3>Testing all three commands with the new Density parameter:</h3>
<ul>
<li><strong>New-HTMLSection</strong> - Main layout sections</li>
<li><strong>New-HTMLPanel</strong> - Individual panels within sections</li>
<li><strong>New-HTMLContainer</strong> - Generic containers</li>
</ul>
"@ -Color Black

        # Test New-HTMLSection with Density
        New-HTMLSection -HeaderText "โœ… New-HTMLSection with Density = Comfortable" -Density Comfortable {
            New-HTMLInfoCard -Title "Section Test 1" -Number "100%" -Subtitle "Testing New-HTMLSection" -Icon "๐Ÿ“" -IconColor '#0078d4'
            New-HTMLInfoCard -Title "Section Test 2" -Number "100%" -Subtitle "With Density parameter" -Icon "๐Ÿ“Š" -IconColor '#0078d4'
            New-HTMLInfoCard -Title "Section Test 3" -Number "100%" -Subtitle "Should wrap nicely" -Icon "๐Ÿ“ˆ" -IconColor '#0078d4'
        }

        # Test New-HTMLPanel with Density
        New-HTMLSection -HeaderText "โœ… New-HTMLPanel with Density = Dense" {
            New-HTMLPanel -Density Dense {
                New-HTMLInfoCard -Title "Panel Test A" -Number "โœ“" -Subtitle "Testing New-HTMLPanel" -Icon "๐Ÿ”ง" -IconColor '#198754' -Style "Compact"
                New-HTMLInfoCard -Title "Panel Test B" -Number "โœ“" -Subtitle "With Density parameter" -Icon "โš™๏ธ" -IconColor '#198754' -Style "Compact"
                New-HTMLInfoCard -Title "Panel Test C" -Number "โœ“" -Subtitle "Dense layout works" -Icon "๐Ÿ› ๏ธ" -IconColor '#198754' -Style "Compact"
                New-HTMLInfoCard -Title "Panel Test D" -Number "โœ“" -Subtitle "More cards per row" -Icon "๐Ÿ”ฉ" -IconColor '#198754' -Style "Compact"
                New-HTMLInfoCard -Title "Panel Test E" -Number "โœ“" -Subtitle "Efficient spacing" -Icon "๐Ÿ”จ" -IconColor '#198754' -Style "Compact"
            }
        }

        # Test New-HTMLContainer with Density
        New-HTMLSection -HeaderText "โœ… New-HTMLContainer with Density = Spacious" {
            New-HTMLContainer -Density Spacious {
                New-HTMLInfoCard -Title "Container Test I" -Number "OK" -Subtitle "Testing New-HTMLContainer" -Icon "๐Ÿ“ฆ" -IconColor '#6f42c1'
                New-HTMLInfoCard -Title "Container Test II" -Number "OK" -Subtitle "With Density parameter" -Icon "๐Ÿ“‹" -IconColor '#6f42c1'
                New-HTMLInfoCard -Title "Container Test III" -Number "OK" -Subtitle "Spacious layout" -Icon "๐Ÿ“‘" -IconColor '#6f42c1'
            }
        }

        # Test clean density-only approach
        New-HTMLSection -HeaderText "๐ŸŽฏ Clean Density-Only Approach" -Density VeryDense {
            New-HTMLInfoCard -Title "Clean 1" -Number "Perfect" -Subtitle "Only Density parameter needed" -Icon "๐ŸŽฏ" -IconColor '#ffc107' -Style "Compact"
            New-HTMLInfoCard -Title "Clean 2" -Number "Simple" -Subtitle "No confusing parameters" -Icon "โœจ" -IconColor '#ffc107' -Style "Compact"
            New-HTMLInfoCard -Title "Clean 3" -Number "Intuitive" -Subtitle "Just pick density level" -Icon "๐ŸŽจ" -IconColor '#ffc107' -Style "Compact"
            New-HTMLInfoCard -Title "Clean 4" -Number "Easy" -Subtitle "VeryDense = small cards" -Icon "๐Ÿ“" -IconColor '#ffc107' -Style "Compact"
            New-HTMLInfoCard -Title "Clean 5" -Number "Nice" -Subtitle "Automatic wrapping" -Icon "๐Ÿ”„" -IconColor '#ffc107' -Style "Compact"
        }

        New-HTMLText -Text @"
<h3>๐Ÿ“‹ Test Results:</h3>
<ul>
<li>โœ… <strong>New-HTMLSection</strong> supports Density parameter</li>
<li>โœ… <strong>New-HTMLPanel</strong> supports Density parameter</li>
<li>โœ… <strong>New-HTMLContainer</strong> supports Density parameter</li>
<li>โœ… <strong>Clean API</strong> - no confusing MinItemsPerRow or ResponsiveWrap parameters!</li>
</ul>

<p><strong>๐ŸŽฏ Perfect!</strong> Simple, intuitive Density parameter works across all three commands.</p>
<p><em>Resize browser window to test responsive behavior.</em></p>
"@ -Color Black
    }
} -FilePath "$PSScriptRoot\Test-AllCommands-Density.html" -TitleText "Density Parameter Tests" -Online -Show