test/html-output.ps1

# alle cmdlets bringen ihre reports hier unter
# (hätte den Vorteil, dass Reports komplett zusammenstellbar sind, i.e.
# der User führt irgendwelche CmdLets aus, und kann sich dann den Report zusammenstellen)
$script:ReportParts = @{}

Function Check-Something
{
    Param()

    $script:ReportParts["Check-Something"] = @{
        name = "Check Something"
        type = "table"
        headers = ("property1", "property2")
        rows = ($ob1, $obj2)
    }
}

# hier muss noch kurz überlegt werden, wie das default verhalten sein soll.
Function Make-HtmlReport
{
    Param(
        
    )

    if (!$script:ReportParts.length){
        # perform default checks, so that ReportParts is filled
    }

    [string]$html = "<header>";

    foreach ($e in $script:ReportParts.GetEnumerator())
    {
        $part = $e.Value()
        $html += "<div class='container'><h1>$($part.name)</h1>"

        if($part.type -eq "table")
        {
            $html += "<table><tr>"
            foreach($head in $part.headers)
            {
                $html += "<th>$head</th>"
            }
            $html += "</tr>"

            foreach($obj in $part.rows)
            {
                $html += "<tr>"

                foreach($head in $part.headers)
                {
                    $html += "<td>$($obj.$head)</td>"
                }

                $html += "</tr>"
            }
        }

        $html_part += "</div>"
    }
}

# SIG # Begin signature block
# MIIL/AYJKoZIhvcNAQcCoIIL7TCCC+kCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDuKnQ1NHjb7VkD
# jGpoGkcV7Eqfxhk4/Wlj/kbSNgCPFqCCCUAwggSZMIIDgaADAgECAhBxoLc2ld2x
# r8I7K5oY7lTLMA0GCSqGSIb3DQEBCwUAMIGpMQswCQYDVQQGEwJVUzEVMBMGA1UE
# ChMMdGhhd3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2Vz
# IERpdmlzaW9uMTgwNgYDVQQLEy8oYykgMjAwNiB0aGF3dGUsIEluYy4gLSBGb3Ig
# Y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