-
Notifications
You must be signed in to change notification settings - Fork 342
Expand file tree
/
Copy pathOut-udfHTML.ps1
More file actions
27 lines (21 loc) · 850 Bytes
/
Out-udfHTML.ps1
File metadata and controls
27 lines (21 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function Out-udfHTML ([string] $p_headingbackcolor, [switch] $AlternateRows)
{
<#
For demo purposes only.
#>
If ($AlternateRows) {$tr_alt = "TR:Nth-Child(Even) {Background-Color: #dddddd;}"}
$format = @"
<style>
TABLE {border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}
TH {border-width: 1px;padding: 3px;border-style: solid;border-color: black;background-color: $p_headingbackcolor;}
$tr_alt
TD {border-width: 1px;padding: 3px;border-style: solid;border-color: black;}
</style>
"@
RETURN $format
}
# Remove-Module "sqlps"
<#
Get-ChildItem | Select-Object -Property name, LastWriteTime | ConvertTo-HTML -Head (Out-udfHTML "lightblue" -AlternateRows) -Pre "<h1>File List</h1>" -Post ("<h1>As of " + (Get-Date) + "</h1>") | Out-File MyReport.HTML
Invoke-Item MyReport.HTML
#>