├── .gitignore ├── .vscode └── settings.json ├── CI ├── 02_Install.ps1 ├── 03_Build.ps1 ├── 03_postContent.ps1 ├── 04_Tests.ps1 └── Tests.AzureDevops.ps1 ├── CONTRIBUTING.md ├── Change_Log.md ├── Code ├── Classes │ ├── 001.pshtml.utilities.configuration.png │ ├── 001.pshtml.utilities.configuration.ps1 │ ├── 002.pshtml.utilities.logging.png │ ├── 002.pshtml.utilities.logging.ps1 │ ├── 003.pshtml.components.charts.png │ ├── 003.pshtml.components.charts.ps1 │ ├── 004.pshtml.components.includes.png │ └── 004.pshtml.components.includes.ps1 └── Functions │ ├── Private │ ├── Clear-WhiteSpace.Ps1 │ ├── Get-HTMLTemplate.ps1 │ ├── Get-LogfilePath.Ps1 │ ├── Get-ModuleRoot.ps1 │ ├── Set-HTMLTag.ps1 │ ├── Write-Error.1.ps1 │ ├── Write-PSHTMLLog.ps1 │ ├── Write-Verbose.ps1 │ └── Write-Warning.ps1 │ └── Public │ ├── Clear-WhiteSpace.Ps1 │ ├── ConvertTo-HtmlTable.ps1 │ ├── ConvertTo-PSHtmlTable.ps1 │ ├── Form.ps1 │ ├── Get-PSHTMLAsset.ps1 │ ├── Get-PSHTMLColor.ps1 │ ├── Get-PSHTMLConfiguration.ps1 │ ├── Get-PSHTMLInclude.ps1 │ ├── Header.ps1 │ ├── Install-PSHTMLVSCodeSnippets.ps1 │ ├── New-PSHTMLCDNAssetFile.ps1 │ ├── New-PSHTMLChart.ps1 │ ├── New-PSHTMLChartBarDataSet.ps1 │ ├── New-PSHTMLChartDataSet.ps1 │ ├── New-PSHTMLChartDoughnutDataSet.ps1 │ ├── New-PSHTMLChartLineDataSet.ps1 │ ├── New-PSHTMLChartPieDataSet.ps1 │ ├── New-PSHTMLChartPolarAreaDataSet.ps1 │ ├── New-PSHTMLChartRadarDataSet.ps1 │ ├── New-PSHTMLDropDownList.ps1 │ ├── New-PSHTMLDropDownListItem.ps1 │ ├── Out-PSHTMLDocument.ps1 │ ├── Write-PSHTMLAsset.ps1 │ ├── Write-PSHTMLInclude.ps1 │ ├── Write-PSHTMLMenu.ps1 │ ├── Write-PSHTMLSymbol.ps1 │ ├── a.ps1 │ ├── address.ps1 │ ├── area.ps1 │ ├── article.ps1 │ ├── aside.ps1 │ ├── b.ps1 │ ├── base.ps1 │ ├── blockquote.ps1 │ ├── body.ps1 │ ├── br.ps1 │ ├── button.ps1 │ ├── canvas.ps1 │ ├── caption.ps1 │ ├── col.ps1 │ ├── colgroup.ps1 │ ├── datalist.ps1 │ ├── dd.ps1 │ ├── div.ps1 │ ├── dl.ps1 │ ├── doctype.ps1 │ ├── dt.ps1 │ ├── em.ps1 │ ├── fieldset.ps1 │ ├── figcaption.ps1 │ ├── figure.ps1 │ ├── footer.ps1 │ ├── h1.ps1 │ ├── h2.ps1 │ ├── h3.ps1 │ ├── h4.ps1 │ ├── h5.ps1 │ ├── h6.ps1 │ ├── head.ps1 │ ├── hr.ps1 │ ├── html.ps1 │ ├── i.ps1 │ ├── img.ps1 │ ├── input.ps1 │ ├── keygen.ps1 │ ├── label.ps1 │ ├── legend.ps1 │ ├── li.ps1 │ ├── link.ps1 │ ├── map.ps1 │ ├── math.ps1 │ ├── meta.ps1 │ ├── meter.ps1 │ ├── nav.ps1 │ ├── noscript.ps1 │ ├── ol.ps1 │ ├── optgroup.ps1 │ ├── option.ps1 │ ├── output.ps1 │ ├── p.ps1 │ ├── pre.ps1 │ ├── progress.ps1 │ ├── script.ps1 │ ├── section.ps1 │ ├── selecttag.ps1 │ ├── small.ps1 │ ├── span.ps1 │ ├── strong.ps1 │ ├── style.ps1 │ ├── sub.ps1 │ ├── sup.ps1 │ ├── table.ps1 │ ├── tbody.ps1 │ ├── td.ps1 │ ├── textarea.ps1 │ ├── tfoot.ps1 │ ├── th.ps1 │ ├── thead.ps1 │ ├── title.ps1 │ ├── tr.ps1 │ └── ul.ps1 ├── ISSUE_TEMPLATE.md ├── Known_Issues.md ├── LICENSE ├── Logos ├── logo_blanc_sanstexte.png ├── logo_rectangle_fond_bleu.jpg └── logo_rond.png ├── PITCHME.md ├── PITCHME.yaml ├── PSHTML ├── Assets │ ├── BootStrap │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.js │ ├── Chartjs │ │ ├── Chart.bundle.min.js │ │ └── LICENSE.md │ └── Jquery │ │ └── jquery-3.3.1.slim.min.js ├── Examples │ ├── Charts │ │ ├── Chart01 │ │ │ ├── BarChartExample.png │ │ │ ├── Chart1.html │ │ │ ├── Chart1.ps1 │ │ │ └── MeetupAttendance.png │ │ ├── Chart02 │ │ │ ├── FRPSUGMeetup.ps1 │ │ │ └── MeetupGraph.html │ │ ├── Chart03 │ │ │ └── GraphCode.html │ │ ├── Chart04 │ │ │ ├── 3graphs.html │ │ │ ├── 4Charts.ps1 │ │ │ └── 4graphs.html │ │ ├── Chart05 │ │ │ ├── BarChart.html │ │ │ └── BasicBarChart.ps1 │ │ ├── Chart06 │ │ │ ├── BasicPieChart.html │ │ │ └── BasicPieChart.ps1 │ │ ├── Chart07 │ │ │ ├── BasicDoughnutChart.html │ │ │ └── BasicDoughnutChart.ps1 │ │ ├── Chart08 │ │ │ ├── HorizontalBarChart.html │ │ │ └── HorizontalBarChart.ps1 │ │ ├── Chart09 │ │ │ ├── RadarChart.html │ │ │ └── RadarChart.ps1 │ │ └── Chart10 │ │ │ ├── PolarArea.html │ │ │ └── PolarAreaChart.ps1 │ ├── Example-ConvertTo-HTMLtable.png │ ├── Example03.ps1 │ ├── Example07 │ │ └── DropDownExamples.ps1 │ ├── Example10 │ │ ├── Example10.ps1 │ │ └── PSHTML_Basic_Example.html │ ├── Example11 │ │ ├── Example11.html │ │ └── Example11.ps1 │ ├── Example12 │ │ └── Example12.ps1 │ ├── Example13 │ │ └── Example13.ps1 │ ├── Example14 │ │ └── Example14.ps1 │ ├── Example15 │ │ └── Example15.ps1 │ ├── Example16 │ │ └── Example16.ps1 │ ├── Example17 │ │ └── Example17.ps1 │ ├── Example18 │ │ ├── Example18.Tests.ps1 │ │ ├── Example18.ps1 │ │ ├── PesterReport.html │ │ └── TestREsults.Json │ ├── Example4.1 │ │ ├── Example4.1.ps1 │ │ └── Templates │ │ │ ├── Body.ps1 │ │ │ ├── Footer.ps1 │ │ │ └── Head.ps1 │ ├── Example4 │ │ ├── Example04.ps1 │ │ └── Templates │ │ │ ├── Body.ps1 │ │ │ └── Footer.ps1 │ ├── Example5 │ │ ├── Example5.html │ │ └── Example5.ps1 │ ├── Example6 │ │ ├── Example6.html │ │ ├── Example6.ps1 │ │ └── tribute_snover.png │ ├── PSHTML_Example2.html │ ├── example01.ps1 │ └── example02.ps1 ├── Includes │ └── .gitkeep ├── PSHTML.psd1 ├── PSHTML.psm1 ├── Snippets │ ├── PsHtml_BaseWithBootStrapAndJquery.Snippet.code-snippets │ ├── PsHtml_BaseWithBootStrapJqueryAndChartJS.Snippet.code-snippets │ ├── PsHtml_Basic.Snippet.code-snippets │ ├── PsHtml_BoilerPlate_full.Snippet.code-snippets │ ├── PsHtml_BoilerPlate_medium.Snippet.code-snippets │ ├── PsHtml_BoilerPlate_small.Snippet.code-snippets │ └── PsHtml_full.Snippet.code-snippets └── pshtml.configuration.json ├── PSHTML_2020.png ├── PULL_REQUEST_TEMPLATE.md ├── README.md ├── Tests ├── 001.pshtml.utilities.configuration.Tests.Ps1 ├── 002.pshtml.utilities.logging.Tests.Ps1 ├── Address.Tests.ps1 ├── Area.Tests.ps1 ├── Article.Tests.ps1 ├── Aside.Tests.ps1 ├── Body.Tests.ps1 ├── Button.Tests.ps1 ├── Canvas.Tests.ps1 ├── Caption.Tests.ps1 ├── Chart.BarChart.Tests.ps1 ├── Chart.Chart.Tests.ps1 ├── Chart.ChartData.Tests.ps1 ├── Chart.ChartOptions.Tests.ps1 ├── Chart.ChartOptionsBar.Tests.ps1 ├── Chart.ChartOptionsDoughnut.Tests.ps1 ├── Chart.ChartOptionsLine.Tests.ps1 ├── Chart.ChartOptionsPie.Tests.ps1 ├── Chart.ChartType.Tests.ps1 ├── Chart.Dataset.Tests.ps1 ├── Chart.DatasetBar.Tests.ps1 ├── Chart.DatasetDoughnut.Tests.ps1 ├── Chart.DatasetLine.Tests.ps1 ├── Chart.DatasetPie.Tests.ps1 ├── Chart.DoughnutChart.Tests.ps1 ├── Chart.LineChart.Tests.ps1 ├── Chart.New-PSHTMLChart.Tests.ps1 ├── Chart.New-PSHTMLChartBarDataSet.Tests.ps1 ├── Chart.New-PSHTMLChartDoughnutDataSet.Tests.ps1 ├── Chart.New-PSHTMLChartLineDataSet.Tests.ps1 ├── Chart.New-PSHTMLChartPieDataSet.Tests.ps1 ├── Chart.New-PSHTMLChartPolarAreaDataSet.Tests.ps1 ├── Chart.PieChart.Tests.ps1 ├── Col.Tests.ps1 ├── Colgroup.Tests.ps1 ├── ConvertTo-PSHtmlTable.Tests.ps1 ├── Div.Tests.ps1 ├── Footer.Tests.ps1 ├── Form.Tests.ps1 ├── Get-PSHTMLColor.Tests.ps1 ├── Get-PSHTMLInclude.Tests.ps1 ├── H1.Tests.ps1 ├── H2.Tests.ps1 ├── H3.Tests.ps1 ├── H4.Tests.ps1 ├── H5.Tests.ps1 ├── H6.Tests.ps1 ├── Head.Tests.ps1 ├── Header.Tests.ps1 ├── Html.Tests.ps1 ├── Input.Tests.ps1 ├── Install-PSHTMLVSCodeSnippets.tests.ps1 ├── Math.Tests.ps1 ├── Meter.Tests.ps1 ├── New-PSHTMLCDNAssetFile.Tests.ps1 ├── New-PSHTMLDropDownList.Tests.ps1 ├── NoScript.Tests.ps1 ├── Out-PSHTMLDocument.Tests.ps1 ├── Output.Tests.ps1 ├── Progress.Tests.ps1 ├── Pshtml.Utilities.Assets.Unit.Tests.Ps1 ├── Pshtml.Utilities.Configuration.LogSettings.Tests.Ps1 ├── Pshtml.Utilities.Configuration.Unit.Tests.Ps1 ├── Script.Tests.ps1 ├── Section.Tests.ps1 ├── TBody.Tests.ps1 ├── Table.Tests.ps1 ├── TextArea.Tests.ps1 ├── Tfoot.Tests.ps1 ├── Thead.Tests.ps1 ├── Title.Tests.ps1 ├── Write-PSHTMLInclude.Tests.ps1 ├── Write-PSHTMLMenu.Tests.ps1 ├── Write-PSHTMLSymbol.Tests.ps1 ├── a.Tests.ps1 ├── b.Tests.ps1 ├── base.Tests.ps1 ├── blockquote.tests.ps1 ├── br.Tests.ps1 ├── button.Tests.ps1.ps1 ├── datalist.tests.ps1 ├── dd.tests.ps1 ├── dl.tests.ps1 ├── dt.tests.ps1 ├── em.Tests.ps1 ├── fieldset.Tests.ps1 ├── figcaption.tests.ps1 ├── figure.tests.ps1 ├── hr.tests.ps1 ├── i.Tests.ps1 ├── img.Tests.ps1 ├── keygen.Tests.ps1 ├── label.Tests.ps1 ├── legend.Tests.ps1 ├── li.tests.ps1 ├── link.tests.ps1 ├── map.Tests.ps1 ├── meta.Tests.ps1 ├── nav.Tests.ps1 ├── ol.tests.ps1 ├── optgroup.tests.ps1 ├── option.tests.ps1 ├── p.tests.ps1 ├── pre.tests.ps1 ├── pshtml.components.includes.Tests.Ps1 ├── selecttag.Tests.ps1 ├── small.Tests.ps1 ├── span.Tests.ps1 ├── strong.Tests.ps1 ├── style.Tests.ps1 ├── sub.tests.ps1 ├── sup.tests.ps1 ├── th.Tests.ps1 └── ul.tests.ps1 ├── appveyor.yml ├── azure-pipelines.yml ├── docs ├── Assets │ └── Assets.md ├── Change_Log.md ├── Charts │ ├── Charts.Bar.Md │ ├── Charts.Doughnut.Md │ ├── Charts.Line.Md │ ├── Charts.Pie.Md │ ├── Charts.PolarArea.md │ ├── Charts.Radar.md │ ├── Charts.md │ └── charts.horizontalBar.md ├── Colors │ └── Colors.md ├── Images │ ├── 001.pshtml.utilities.configuration.jpg │ ├── 002.pshtml.utilities.logging.png │ ├── BarChart_basic_01.png │ ├── Chart.HorizontalBar.Example.jpg │ ├── Chart.PolarArea.Example.jpg │ ├── Chart.Radar.Example.jpg │ ├── Charts_Overview.png │ ├── Chartsoverview2.jpg │ ├── DoughnutChart_basic_01.png │ ├── DropDownExample.jpg │ ├── Example01.jpg │ ├── Example02.jpg │ ├── LineChart_basic_01.png │ ├── PieChart_basic_01.png │ ├── get-pshtmlcolor-example-chart.jpg │ ├── psconf_intro.jpg │ ├── pshtml_ClassDiagram.png │ └── snippets.jpg ├── Includes │ ├── Get-HTMLTemplate.md │ └── Overview.md ├── Locations │ └── Locations.md ├── Miscellaneous │ └── Write-PSHTMLSymbol.md ├── Tables │ └── ConvertTo-HTMLTable.md ├── Tags │ ├── Body.md │ ├── Caption.md │ ├── Col.md │ ├── Colgroup.md │ ├── Div.md │ ├── Footer.md │ ├── Form.md │ ├── H1.md │ ├── Link.md │ ├── Noscript.md │ ├── Set-HtmlTag.md │ ├── Table.md │ ├── Tbody.md │ ├── Th.md │ ├── Thead.md │ ├── Title.md │ ├── ToDo.md │ ├── a.md │ ├── address.md │ ├── area.md │ ├── article.md │ ├── aside.md │ ├── base.md │ ├── blockquote.md │ ├── button.md │ ├── dd.md │ ├── dl.md │ ├── dt.md │ ├── fieldset.md │ ├── figcaption.md │ ├── figure.md │ ├── h2.md │ ├── h3.md │ ├── h4.md │ ├── h5.md │ ├── h6.md │ ├── head.md │ ├── header.md │ ├── hr.md │ ├── html.md │ ├── img.md │ ├── input.md │ ├── label.md │ ├── legend.md │ ├── li.md │ ├── map.md │ ├── meta.md │ ├── nav.md │ ├── ol.md │ ├── p.md │ ├── pre.md │ ├── script.md │ ├── section.md │ ├── selecttag.md │ ├── strong.md │ ├── style.md │ ├── td.md │ ├── tfoot.md │ ├── tr.md │ └── ul.md ├── _HowToUsePSHTML.md ├── hands-on │ ├── PSHTMLwithNodeJS.md │ ├── PSHTMLwithPolaris.md │ └── selectTag-UseCase.md └── index.md ├── mkdocs.yml └── tagv3Prototype.ps1 /.gitignore: -------------------------------------------------------------------------------- 1 | thoughts.md 2 | PSHTML_Example.html 3 | Functions/Public/New-HTMLHeader.ps1 4 | /temp/* -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.renderWhitespace": "all", 3 | "editor.tabSize": 4, 4 | "editor.insertSpaces": true, 5 | "editor.detectIndentation": false, 6 | "powershell.codeFormatting.ignoreOneLineBlock": false, 7 | "powershell.codeFormatting.newLineAfterCloseBrace": true, 8 | "powershell.codeFormatting.newLineAfterOpenBrace": true, 9 | "powershell.codeFormatting.openBraceOnSameLine": true, 10 | "powershell.codeFormatting.whitespaceAfterSeparator": true 11 | } -------------------------------------------------------------------------------- /CI/02_Install.ps1: -------------------------------------------------------------------------------- 1 | 2 | write-host "[INSTALL] Start" -ForegroundColor Red -BackgroundColor White 3 | write-host "[INSTALL] Install core modules" -ForegroundColor Red -BackgroundColor White 4 | Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser 5 | Install-Module -Name Pester -Force -Scope CurrentUser 6 | write-host "[INSTALL] End" -ForegroundColor Red -BackgroundColor White -------------------------------------------------------------------------------- /CI/03_postContent.ps1: -------------------------------------------------------------------------------- 1 | #Post Content 2 | 3 | $ScriptPath = Split-Path -Path $MyInvocation.MyCommand.Path 4 | $ScriptPath = Split-Path -Path $PSScriptRoot 5 | New-Alias -Name Include -Value 'Write-PSHTMLInclude' -Description "Include parts of PSHTML documents using include files" -Force 6 | function Get-ScriptDirectory { 7 | Split-Path -Parent $PSCommandPath 8 | } 9 | $ScriptPath = Get-ScriptDirectory 10 | $CF = Join-Path -Path $ScriptPath -ChildPath "pshtml.configuration.json" 11 | #Write-host "loading config file: $($CF)" -ForegroundColor Blue 12 | #Setting module variables 13 | $Script:PSHTML_CONFIGURATION = Get-ConfigurationDocument -Path $CF -Force 14 | $Script:Logfile = $Script:PSHTML_CONFIGURATION.GetDefaultLogFilePath() 15 | $Script:Logger = [Logger]::New($Script:LogFile) 16 | -------------------------------------------------------------------------------- /CI/Tests.AzureDevops.ps1: -------------------------------------------------------------------------------- 1 | 2 | $PSVersionTable 3 | install-module pester -Force 4 | $TestsFolder = join-path -path "$($env:BUILD_SOURCESDIRECTORY)" -childpath "Tests" 5 | write-host "sourcedirectory = $($env:BUILD_SOURCESDIRECTORY)" 6 | gci $env:BUILD_SOURCESDIRECTORY 7 | set-location $TestsFolder 8 | $res = Invoke-Pester -Path $TestsFolder -OutputFormat NUnitXml -OutputFile TestsResults.xml -PassThru #-CodeCoverage $TestFiles 9 | 10 | if ($res.FailedCount -gt 0 -or $res.PassedCount -eq 0) { 11 | throw "$($res.FailedCount) tests failed - $($res.PassedCount) successfully passed" 12 | }; 13 | $PSVersionTable -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # To contribute please follow these rules 2 | 3 | ## What can I do? 4 | 5 | To determine what you could help with, you can: 6 | 7 | - Open an issue if you have an idea for improvement. 8 | - Check in the Issues if anything needs to be fixed. 9 | - Are you a beginner? Search for issues with the 'Beginner friendly' label! 10 | 11 | ## Name your branch 12 | 13 | According to the type of submission you are planning to make, create a branch called: 14 | 15 | - Feature: "Feature_" 16 | - BugFix: "BugFix_" 17 | - Minor: "Minor_" 18 | 19 | ## Development 20 | 21 | Functions and classes should be written in a seperate files. 22 | 23 | > Exceptions to this rule apply. Sometimes it makes more sense to group things by 'theme' (e.g. the charts classes and functions). That is also OK. The thing to keep in mind is **not** to write your code directly in the `pshtml.psm1` file. 24 | 25 | 26 | ### Functions 27 | 28 | Functions need to go in `Code\Functions\Public\$FunctionName.ps1` Or `Code\Functions\Private\$FunctionName.ps1` for private functions. 29 | 30 | ### Classes 31 | 32 | Classes should be located in `Code\Classes\$ClassName.ps1` 33 | 34 | ## Building the module 35 | 36 | Once the developement is done, you need to build the module by calling `CI\03_Build.ps1` file. It will generate the `pshtml.psm1` and the `pshtml.psd1` 37 | 38 | All the files that have been generated (`pshtml.ps1` and `pshtml.psd1`) and the developement file that are part of you PR 39 | 40 | ## When creating a Pull Request (PR) be sure to 41 | 42 | 1. Have added comment 43 | 2. If it is a new feature / cmdlet, some help (comment based help will suffice in most cases) 44 | 3. One or two examples on how to use it 45 | -------------------------------------------------------------------------------- /Code/Classes/001.pshtml.utilities.configuration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stephanevg/PSHTML/5c39db936a5cf265a5bb8be8dd3fc7ee2042a6cb/Code/Classes/001.pshtml.utilities.configuration.png -------------------------------------------------------------------------------- /Code/Classes/002.pshtml.utilities.logging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stephanevg/PSHTML/5c39db936a5cf265a5bb8be8dd3fc7ee2042a6cb/Code/Classes/002.pshtml.utilities.logging.png -------------------------------------------------------------------------------- /Code/Classes/003.pshtml.components.charts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stephanevg/PSHTML/5c39db936a5cf265a5bb8be8dd3fc7ee2042a6cb/Code/Classes/003.pshtml.components.charts.png -------------------------------------------------------------------------------- /Code/Classes/004.pshtml.components.includes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stephanevg/PSHTML/5c39db936a5cf265a5bb8be8dd3fc7ee2042a6cb/Code/Classes/004.pshtml.components.includes.png -------------------------------------------------------------------------------- /Code/Classes/004.pshtml.components.includes.ps1: -------------------------------------------------------------------------------- 1 | Class IncludeFile { 2 | 3 | } 4 | 5 | Class Include : IncludeFile { 6 | [String]$Name 7 | [System.IO.DirectoryInfo]$FolderPath 8 | [System.IO.FileInfo]$FilePath 9 | 10 | Include([System.IO.FileInfo]$FilePath){ 11 | $this.FilePath = $FilePath 12 | $this.FolderPath = $FilePath.Directory 13 | $this.Name = $FilePath.BaseName 14 | } 15 | 16 | [String]ToString(){ 17 | 18 | $Rawcontent = [IO.File]::ReadAllText($this.FilePath.FullName) 19 | $Content = [scriptBlock]::Create($Rawcontent).Invoke() 20 | return $content 21 | 22 | } 23 | } 24 | 25 | Class IncludeFactory { 26 | 27 | Static [Include[]] Create([System.IO.DirectoryInfo]$Path){ 28 | If(test-Path $Path){ 29 | 30 | $Items = Get-ChildItem $Path.FullName -Filter "*.ps1" 31 | $AllIncludes = @() 32 | Foreach($Item in $Items){ 33 | $AllIncludes += [Include]::New($Item) 34 | 35 | } 36 | 37 | Return $AllIncludes 38 | }Else{ 39 | Return $null 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Code/Functions/Private/Clear-WhiteSpace.Ps1: -------------------------------------------------------------------------------- 1 | 2 | #From Jakub Jares (Thanks!) 3 | function Clear-WhiteSpace ($Text) { 4 | "$($Text -replace "(`t|`n|`r)"," " -replace "\s+"," ")".Trim() 5 | } -------------------------------------------------------------------------------- /Code/Functions/Private/Get-HTMLTemplate.ps1: -------------------------------------------------------------------------------- 1 | Function Get-HTMLTemplate{ 2 | <# 3 | .Example 4 | 5 | 6 | 7 | html{ 8 | Body{ 9 | 10 | include -name body 11 | 12 | } 13 | Footer{ 14 | Include -Name Footer 15 | } 16 | } 17 | 18 | #Generates the following HTML code 19 | 20 | 21 | 22 | 23 | h2 "This comes a template file" 24 | 25 |
26 | div { 27 | h4 "This is the footer from a template" 28 | p{ 29 | CopyRight from template 30 | } 31 | } 32 |
33 | 34 | #> 35 | [CmdletBinding()] 36 | Param( 37 | $Name 38 | ) 39 | 40 | Throw "This function has been renamed to 'Get-PSHTMLTemplate' and will be removed in a future release .Either use the Alias 'include' or rename your function calls from Get-PSHTMLTemplate to Get-PSHTMLTemplate" 41 | } 42 | -------------------------------------------------------------------------------- /Code/Functions/Private/Get-LogfilePath.Ps1: -------------------------------------------------------------------------------- 1 | Function Get-LogfilePath{ 2 | return $Script:Logfile 3 | } -------------------------------------------------------------------------------- /Code/Functions/Private/Get-ModuleRoot.ps1: -------------------------------------------------------------------------------- 1 | Function Get-ModuleRoot { 2 | [CmdletBinding()] 3 | Param( 4 | ) 5 | return $MyInvocation.MyCommand.Module.ModuleBase 6 | } -------------------------------------------------------------------------------- /Code/Functions/Private/Write-Error.1.ps1: -------------------------------------------------------------------------------- 1 | function Write-Error { 2 | <# 3 | .SYNOPSIS 4 | Proxy function for Write-Error that adds a timestamp and write the message to a log file. 5 | #> 6 | [CmdletBinding()] 7 | param ( 8 | [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] 9 | [AllowNull()] 10 | [System.String] $Message 11 | ) 12 | process { 13 | 14 | if (-not [System.String]::IsNullOrEmpty($Message)) { 15 | 16 | #$Message = Get-FormattedMessage -Message $Message; 17 | $Type = 'Error' 18 | $Msgobj = [LogMessage]::new($Message,$Type) 19 | $FormatedMessage = $Msgobj.ToString() 20 | Write-PSHTMLLog -message $FormatedMessage -type $Type 21 | #Microsoft.PowerShell.Utility\Write-Error -Message $FormatedMessage; 22 | #Overwriting Write-Error would not display message. See https://stackoverflow.com/questions/4998173/how-do-i-write-to-standard-error-in-powershell 23 | $host.ui.WriteErrorLine($FormatedMessage) 24 | } 25 | 26 | } # end process 27 | } #end function -------------------------------------------------------------------------------- /Code/Functions/Private/Write-PSHTMLLog.ps1: -------------------------------------------------------------------------------- 1 | Function Write-PSHTMLLog { 2 | [Cmdletbinding()] 3 | Param( 4 | [String]$Message, 5 | 6 | [ValidateSet("Info","Warning","Error","Information")] 7 | [String]$Type = "info" 8 | ) 9 | 10 | 11 | $Script:Logger.Log($Message) 12 | 13 | 14 | } -------------------------------------------------------------------------------- /Code/Functions/Private/Write-Verbose.ps1: -------------------------------------------------------------------------------- 1 | function Write-Verbose { 2 | <# 3 | .SYNOPSIS 4 | Proxy function for Write-verbose that adds a timestamp and write the message to a log file. 5 | #> 6 | [CmdletBinding()] 7 | param ( 8 | [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] 9 | [AllowNull()] 10 | [System.String] $Message 11 | ) 12 | process { 13 | 14 | if (-not [System.String]::IsNullOrEmpty($Message)) { 15 | 16 | #$Message = Get-FormattedMessage -Message $Message; 17 | $Type = 'Information' 18 | $Msgobj = [LogMessage]::new($Message,$Type) 19 | $FormatedMessage = $Msgobj.ToString() 20 | Write-PSHTMLLog -message $FormatedMessage -type $Type 21 | Microsoft.PowerShell.Utility\Write-Verbose -Message $FormatedMessage; 22 | } 23 | 24 | } # end process 25 | } #end function -------------------------------------------------------------------------------- /Code/Functions/Private/Write-Warning.ps1: -------------------------------------------------------------------------------- 1 | function Write-Warning { 2 | <# 3 | .SYNOPSIS 4 | Proxy function for Write-Warning that adds a timestamp and write the message to a log file. 5 | #> 6 | [CmdletBinding()] 7 | param ( 8 | [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] 9 | [AllowNull()] 10 | [System.String] $Message 11 | ) 12 | process { 13 | 14 | if (-not [System.String]::IsNullOrEmpty($Message)) { 15 | 16 | #$Message = Get-FormattedMessage -Message $Message; 17 | $Type = 'Warning' 18 | $Msgobj = [LogMessage]::new($Message,$Type) 19 | $FormatedMessage = $Msgobj.ToString() 20 | Write-PSHTMLLog -message $FormatedMessage -type $Type 21 | Microsoft.PowerShell.Utility\Write-Warning -Message $FormatedMessage; 22 | } 23 | 24 | } # end process 25 | } #end function -------------------------------------------------------------------------------- /Code/Functions/Public/Clear-WhiteSpace.Ps1: -------------------------------------------------------------------------------- 1 | 2 | #From Jakub Jares (Thanks!) 3 | function Clear-WhiteSpace ($Text) { 4 | "$($Text -replace "(`t|`n|`r)"," " -replace "\s+"," ")".Trim() 5 | } -------------------------------------------------------------------------------- /Code/Functions/Public/ConvertTo-HtmlTable.ps1: -------------------------------------------------------------------------------- 1 | Function ConvertTo-HTMLTable { 2 | 3 | <# 4 | .SYNOPSIS 5 | This cmdlet is deprecated. Use ConvertTo-PSHTMLTable instead. 6 | 7 | 8 | 9 | 10 | .LINK 11 | https://github.com/Stephanevg/PSHTML 12 | #> 13 | [CmdletBinding()] 14 | Param( 15 | [Parameter(Mandatory = $true, ValueFromPipeline = $true)] 16 | $Object, 17 | [String[]]$Properties 18 | ) 19 | Write-Warning "ConvertTo-HTMLTable is deprecated and will be removed in a future version. Please use ConvertTo-PSHTMLTable instead" 20 | ConvertTo-PSHTMLTable @PSBoundParameters 21 | } 22 | 23 | -------------------------------------------------------------------------------- /Code/Functions/Public/Get-PSHTMLConfiguration.ps1: -------------------------------------------------------------------------------- 1 | Function Get-PSHTMLConfiguration { 2 | <# 3 | .SYNOPSIS 4 | Returns the PSHTML current configuration 5 | .DESCRIPTION 6 | Use this cmdlet to get the configuration that is currently loaded. 7 | It is possible to access the different parts off the configuration using specific methods (See example section). 8 | 9 | Use (Get-PSHTMLConfiguration).LoadConfigurationData() to reapply a configuration file. 10 | 11 | .EXAMPLE 12 | Get-PSHTMLConfiguration 13 | .EXAMPLE 14 | (Get-PSHTMLConfiguration).GetGeneralConfig() 15 | Returns the global settings current applied in PSHTML 16 | .EXAMPLE 17 | (Get-PSHTMLConfiguration).GetAssetsConfig() 18 | Returns the assets that are currently present in PSHTML 19 | .EXAMPLE 20 | (Get-PSHTMLConfiguration).GetLogConfig() 21 | Returns the logging settings currently set for PSHTML 22 | 23 | .Example 24 | (Get-PSHTMLConfiguration).LoadConfigurationData() 25 | Allows to relead the configuration file data into memory. 26 | 27 | .Example 28 | It is possible to set new values to for the PSHTML environment as follows: 29 | 30 | $Settings = Get-PSHTMLConfiguration 31 | $Settings.Data.Logging.MaxFiles = 100 32 | 33 | This will change the default allowed number of log files to 100. 34 | 35 | This setting will be present only during this session. It will be overwritten at each reload of the module, or when the .LoadConfiguration() method is used. 36 | 37 | .INPUTS 38 | None 39 | .OUTPUTS 40 | [ConfigurationFile] 41 | .NOTES 42 | General notes 43 | #> 44 | return $Script:PSHTML_Configuration 45 | 46 | } -------------------------------------------------------------------------------- /Code/Functions/Public/New-PSHTMLChartPieDataSet.ps1: -------------------------------------------------------------------------------- 1 | function New-PSHTMLChartPieDataSet { 2 | <# 3 | .SYNOPSIS 4 | Create a dataset object for a Pie chart 5 | .DESCRIPTION 6 | Create a dataset object for a Line chart 7 | .EXAMPLE 8 | 9 | .INPUTS 10 | Inputs (if any) 11 | .OUTPUTS 12 | DataSetLine 13 | .NOTES 14 | 15 | .LINK 16 | https://github.com/Stephanevg/PSHTML 17 | #> 18 | [CmdletBinding()] 19 | param ( 20 | [Array]$Data, 21 | [String]$label, 22 | [array]$backgroundColor, 23 | [String]$borderColor, 24 | [int]$borderWidth = 1, 25 | [array]$hoverBackgroundColor, 26 | [string]$HoverBorderColor, 27 | [int]$HoverBorderWidth 28 | 29 | 30 | ) 31 | 32 | $Datachart = [datasetPie]::New() 33 | 34 | if($Data){ 35 | $null = $Datachart.AddData($Data) 36 | } 37 | 38 | If($Label){ 39 | $Datachart.label = $label 40 | } 41 | 42 | if($backgroundColor){ 43 | $Datachart.AddBackGroundColor($backgroundColor) 44 | #$Datachart.backgroundColor = $backgroundColor 45 | } 46 | 47 | If($borderColor){ 48 | $Datachart.borderColor = $borderColor 49 | } 50 | if ($borderWidth){ 51 | $Datachart.borderWidth = $borderWidth 52 | } 53 | 54 | If($hoverBackgroundColor){ 55 | $Datachart.AddHoverBackGroundColor($hoverBackgroundColor) 56 | #$Datachart.hoverBackgroundColor = $hoverBackgroundColor 57 | }else{ 58 | $Datachart.AddHoverBackGroundColor($backgroundColor) 59 | } 60 | 61 | if($HoverBorderColor){ 62 | $Datachart.HoverBorderColor = $HoverBorderColor 63 | } 64 | 65 | if ($HoverborderWidth){ 66 | $Datachart.HoverBorderWidth = $HoverborderWidth 67 | } 68 | 69 | return $Datachart 70 | } -------------------------------------------------------------------------------- /Code/Functions/Public/Out-PSHTMLDocument.ps1: -------------------------------------------------------------------------------- 1 | function Out-PSHTMLDocument { 2 | <# 3 | .SYNOPSIS 4 | Outputs the HTML document to an output location 5 | .DESCRIPTION 6 | Output the html string into a file. 7 | .EXAMPLE 8 | The following example gets the list of first 5 processes. Converts it into an HTML Table. It outputs the results in a file, and opens the results imédiatley. 9 | 10 | $o = Get-PRocess | select ProcessName,Handles | select -first 5 11 | $FilePath = "C:\temp\OutputFile.html" 12 | $E = ConvertTo-PSHTMLTable -Object $o 13 | $e | Out-PSHTMLDocument -OutPath $FilePath -Show 14 | 15 | .INPUTS 16 | String 17 | .OUTPUTS 18 | None 19 | .NOTES 20 | 21 | Author: Stéphane van Gulick 22 | 23 | 24 | .LINK 25 | https://github.com/Stephanevg/PSHTML 26 | #> 27 | [CmdletBinding()] 28 | param ( 29 | $OutPath = $(Throw "Must provide a path"), 30 | 31 | [Parameter(ValueFromPipeline = $true)] 32 | $HTMLDocument = $(Throw "HTMLDocument cannot be empty"), 33 | 34 | [Parameter(Mandatory = $False)] 35 | [Switch]$Show 36 | ) 37 | 38 | begin { 39 | $Writer = [System.IO.StreamWriter]::New($OutPath,$false,[System.Text.Encoding]::UTF8) 40 | } 41 | 42 | process { 43 | #[System.IO.TextWriter] 44 | Foreach ($Line in $HTMLDocument) { 45 | $writer.WriteLine($Line) 46 | } 47 | } 48 | 49 | end { 50 | $Writer.Close() 51 | If ($Show) { 52 | Invoke-Item -Path $OutPath 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /Code/Functions/Public/aside.ps1: -------------------------------------------------------------------------------- 1 | Function aside { 2 | <# 3 | .SYNOPSIS 4 | Generates aside HTML tag. 5 | 6 | .PARAMETER Class 7 | Allows to specify one (or more) class(es) to assign the html element. 8 | More then one class can be assigned by seperating them with a white space. 9 | 10 | .PARAMETER Id 11 | Allows to specify an id to assign the html element. 12 | 13 | .PARAMETER Style 14 | Allows to specify in line CSS style to assign the html element. 15 | 16 | .PARAMETER Content 17 | Allows to add child element(s) inside the current opening and closing HTML tag(s). 18 | 19 | 20 | .EXAMPLE 21 | 22 | aside { 23 | h4 "This is an aside" 24 | p{ 25 | "This is a paragraph inside the aside block" 26 | } 27 | } 28 | 29 | Generates the following code: 30 | 31 | 37 | 38 | .LINK 39 | https://github.com/Stephanevg/PSHTML 40 | 41 | .NOTES 42 | Current version 3.1 43 | History: 44 | 2018.11.1; Stephanevg;Updated to version 3.1 45 | #> 46 | [CmdletBinding()] 47 | Param( 48 | 49 | [Parameter( 50 | ValueFromPipeline = $true, 51 | Mandatory = $false, 52 | Position = 0 53 | )] 54 | $Content, 55 | 56 | [Parameter(Position = 1)] 57 | [String]$Class, 58 | 59 | [Parameter(Position = 2)] 60 | [String]$Id, 61 | 62 | [Parameter(Position = 3)] 63 | [String]$Style, 64 | 65 | [Parameter(Position = 4)] 66 | [Hashtable]$Attributes 67 | ) 68 | Process { 69 | 70 | $tagname = "aside" 71 | 72 | Set-htmltag -TagName $tagName -Parameters $PSBoundParameters -TagType NonVoid 73 | } 74 | 75 | 76 | } 77 | -------------------------------------------------------------------------------- /Code/Functions/Public/b.ps1: -------------------------------------------------------------------------------- 1 | Function b { 2 | <# 3 | .SYNOPSIS 4 | 5 | Generates a HTML tag. 6 | The tag defines a hyperlink, which is used to link from one page to another. 7 | 8 | .DESCRIPTION 9 | 10 | .PARAMETER Class 11 | Allows to specify one (or more) class(es) to assign the html element. 12 | More then one class can be assigned by seperating them with a white space. 13 | 14 | .PARAMETER Id 15 | Allows to specify an id to assign the html element. 16 | 17 | .PARAMETER Content 18 | Allows to add child element(s) inside the current opening and closing HTML tag(s). 19 | 20 | 21 | .EXAMPLE 22 | The following exapmles show cases how to create an empty b, with a class, an ID, and, custom attributes. 23 | 24 | b -Class "myclass1 MyClass2" -Id myid -Attributes @{"custom1"='val1';custom2='val2'} 25 | 26 | Generates the following code: 27 | 28 | 29 | 30 | 31 | 32 | .NOTES 33 | Current version 3.1 34 | History: 35 | 2019.06.18;@Josh_Burkard;initial version 36 | .LINK 37 | https://github.com/Stephanevg/PSHTML 38 | #> 39 | 40 | Param( 41 | 42 | [Parameter(Mandatory = $false)] 43 | [AllowEmptyString()] 44 | [AllowNull()] 45 | $Content, 46 | 47 | [AllowEmptyString()] 48 | [AllowNull()] 49 | [String]$Class, 50 | 51 | [String]$Id, 52 | 53 | [Hashtable]$Attributes 54 | 55 | ) 56 | $tagname = "b" 57 | 58 | Set-htmltag -TagName $tagName -Parameters $PSBoundParameters -TagType NonVoid 59 | 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /Code/Functions/Public/base.ps1: -------------------------------------------------------------------------------- 1 | Function base { 2 | <# 3 | .SYNOPSIS 4 | Create a base title in an HTML document. 5 | 6 | .DESCRIPTION 7 | The tag specifies the base URL/target for all relative URLs in a document. 8 | 9 | There can be at maximum one element in a document, and it must be inside the element. 10 | 11 | .EXAMPLE 12 | 13 | base 14 | .EXAMPLE 15 | base "woop1" -Class "class" 16 | 17 | .Notes 18 | Author: Stéphane van Gulick 19 | Current Version: 3.1 20 | History: 21 | 2018.11.1; Stephanevg;Updated to version 3.1 22 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 23 | 2018.05.11;@Stephanevg; fixed minor bugs 24 | 2018.05.09;@Stephanevg; Creation 25 | 26 | .LINK 27 | https://github.com/Stephanevg/PSHTML 28 | #> 29 | [Cmdletbinding()] 30 | Param( 31 | 32 | [Parameter(Mandatory = $true)] 33 | [String]$href, 34 | 35 | [ValidateSet("_self", "_blank", "_parent", "_top")] 36 | [String]$Target, 37 | 38 | [AllowEmptyString()] 39 | [AllowNull()] 40 | [String]$Class, 41 | 42 | [String]$Id, 43 | 44 | [Hashtable]$Attributes 45 | ) 46 | 47 | $tagname = "base" 48 | 49 | if(!($Target)){ 50 | 51 | $PSBoundParameters.Target = "_self" 52 | } 53 | 54 | Set-htmltag -TagName $tagName -Parameters $PSBoundParameters -TagType void 55 | 56 | 57 | } 58 | -------------------------------------------------------------------------------- /Code/Functions/Public/br.ps1: -------------------------------------------------------------------------------- 1 | Function br 2 | { 3 | <# 4 | .SYNOPSIS 5 | Create a br in an HTML document. 6 | 7 | .EXAMPLE 8 | 9 | br 10 | 11 | .Notes 12 | Author: Ravikanth Chaganti 13 | Version: 3.1.0 14 | History: 15 | 2018.10.29;rchaganti; Adding br element 16 | .LINK 17 | https://github.com/Stephanevg/PSHTML 18 | #> 19 | [Cmdletbinding()] 20 | param 21 | ( 22 | 23 | [Parameter(Position = 1)] 24 | [String]$Class, 25 | 26 | [Parameter(Position = 2)] 27 | [String]$Id, 28 | 29 | [Parameter(Position = 3)] 30 | [String]$Style, 31 | 32 | [Parameter(Position = 4)] 33 | [Hashtable]$Attributes 34 | ) 35 | 36 | $tagname = "br" 37 | Set-htmltag -TagName $tagName -Parameters $PSBoundParameters -TagType void 38 | } 39 | -------------------------------------------------------------------------------- /Code/Functions/Public/button.ps1: -------------------------------------------------------------------------------- 1 | Function button { 2 | <# 3 | .SYNOPSIS 4 | Creates a 21 | Name:
22 | Email:
23 | Date of birth: 24 | 25 | 26 | 27 | .Notes 28 | Author: Stéphane van Gulick 29 | Version: 3.1 30 | History: 31 | 2018.11.1; Stephanevg;Updated to version 3.1 32 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 33 | 2018.05.09;@Stephanevg; Creation 34 | .LINK 35 | https://github.com/Stephanevg/PSHTML 36 | #> 37 | [Cmdletbinding()] 38 | Param( 39 | [Parameter(Mandatory = $false)] 40 | [AllowEmptyString()] 41 | [AllowNull()] 42 | $Content, 43 | 44 | [String]$Id, 45 | 46 | [AllowEmptyString()] 47 | [AllowNull()] 48 | [String]$Class, 49 | 50 | 51 | 52 | [AllowEmptyString()] 53 | [AllowNull()] 54 | [String]$Style, 55 | 56 | [Hashtable]$Attributes 57 | ) 58 | 59 | 60 | $tagname = "button" 61 | 62 | Set-htmltag -TagName $tagName -Parameters $PSBoundParameters -TagType nonVoid 63 | 64 | 65 | 66 | 67 | } 68 | -------------------------------------------------------------------------------- /Code/Functions/Public/datalist.ps1: -------------------------------------------------------------------------------- 1 | Function datalist { 2 | <# 3 | .SYNOPSIS 4 | Create a datalist tag in an HTML document. 5 | 6 | .DESCRIPTION 7 | 8 | The tag specifies a list of pre-defined options for an element. 9 | 10 | The tag is used to provide an "autocomplete" feature on elements. Users will see a drop-down list of pre-defined options as they input data. 11 | 12 | Use the element's list attribute to bind it together with a element. 13 | 14 | .EXAMPLE 15 | 16 | datalist { 17 | option -value "Volvo" -Content "Volvo" 18 | option -value Saab -Content "saab" 19 | } 20 | 21 | 22 | Generates the following code: 23 | 24 | 25 | 26 | 27 | 28 | .EXAMPLE 29 | 30 | 31 | .NOTES 32 | Current version 3.1 33 | History: 34 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 35 | 2018.10.05;@stephanevg;Creation. 36 | .LINK 37 | https://github.com/Stephanevg/PSHTML 38 | #> 39 | [Cmdletbinding()] 40 | Param( 41 | [Parameter(Mandatory = $false)] 42 | [AllowEmptyString()] 43 | [AllowNull()] 44 | $Content, 45 | 46 | [AllowEmptyString()] 47 | [AllowNull()] 48 | [String]$Class = "", 49 | 50 | [String]$Id, 51 | 52 | [AllowEmptyString()] 53 | [AllowNull()] 54 | [String]$Style, 55 | 56 | [String]$title, 57 | 58 | [Hashtable]$Attributes 59 | ) 60 | 61 | Process { 62 | 63 | $tagname = "datalist" 64 | 65 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType nonVoid 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Code/Functions/Public/dd.ps1: -------------------------------------------------------------------------------- 1 | Function dd { 2 | <# 3 | .SYNOPSIS 4 | Create a dd tag in an HTML document. 5 | 6 | .EXAMPLE 7 | 8 | dd 9 | .EXAMPLE 10 | dd "woop1" -Class "class" 11 | 12 | .EXAMPLE 13 | dd "woop2" -Class "class" -Id "Something" 14 | 15 | .EXAMPLE 16 | dd "woop3" -Class "class" -Id "something" -Style "color:red;" 17 | 18 | .NOTES 19 | Current version 3.1 20 | History: 21 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 22 | 2018.10.02;bateskevin;Updated to v2. 23 | 2018.04.01;bateskevin;Creation. 24 | .LINK 25 | https://github.com/Stephanevg/PSHTML 26 | #> 27 | [Cmdletbinding()] 28 | Param( 29 | [Parameter(Mandatory = $true)] 30 | [AllowEmptyString()] 31 | [AllowNull()] 32 | [String] 33 | $Content, 34 | 35 | [AllowEmptyString()] 36 | [AllowNull()] 37 | [String]$Class = "", 38 | 39 | [String]$Id, 40 | 41 | [AllowEmptyString()] 42 | [AllowNull()] 43 | [String]$Style, 44 | 45 | [String]$value, 46 | 47 | [HashTable]$Attributes 48 | 49 | 50 | ) 51 | 52 | Process { 53 | 54 | $tagname = "dd" 55 | 56 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType nonVoid 57 | 58 | } 59 | } -------------------------------------------------------------------------------- /Code/Functions/Public/div.ps1: -------------------------------------------------------------------------------- 1 | Function Div { 2 | <# 3 | .SYNOPSIS 4 | Generates a DIV HTML tag. 5 | 6 | .EXAMPLE 7 | The following exapmles show cases how to create an empty div, with a class, an ID, and, custom attributes. 8 | div -Class "myclass1 MyClass2" -Id myid -Attributes @{"custom1"='val1';custom2='val2'} 9 | 10 | Generates the following code: 11 | 12 |
13 |
14 | 15 | 16 | .NOTES 17 | Current version 2.0 18 | History: 19 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 20 | 2018.10.02;bateskevin; Updated to v2.0 21 | 2018.04.10;Stephanevg; Added parameters 22 | 2018.04.01;Stephanevg;Creation. 23 | .LINK 24 | https://github.com/Stephanevg/PSHTML 25 | #> 26 | 27 | Param( 28 | 29 | [Parameter( 30 | ValueFromPipeline = $true, 31 | Mandatory = $false, 32 | Position = 0 33 | )] 34 | $Content, 35 | 36 | [Parameter(Position = 1)] 37 | [String]$Class, 38 | 39 | [Parameter(Position = 2)] 40 | [String]$Id, 41 | 42 | [Parameter(Position = 3)] 43 | [String]$Style, 44 | 45 | [Parameter(Position = 4)] 46 | [Hashtable]$Attributes 47 | ) 48 | Process { 49 | 50 | $tagname = "div" 51 | 52 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType nonVoid 53 | } 54 | 55 | 56 | } -------------------------------------------------------------------------------- /Code/Functions/Public/dl.ps1: -------------------------------------------------------------------------------- 1 | Function dl { 2 | <# 3 | .SYNOPSIS 4 | Create a dl tag in an HTML document. 5 | 6 | .EXAMPLE 7 | dl 8 | 9 | .EXAMPLE 10 | dl -Content {dt -Content "Coffe";dl -Content "Black hot drink"} 11 | 12 | .EXAMPLE 13 | dl -Class "class" -Id "something" -Style "color:red;" 14 | 15 | .NOTES 16 | Current version 3.1 17 | History: 18 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 19 | 2018.10.02;bateskevin;Updated to v2. 20 | 2018.05.01;Removed reversed as this is not supported. 21 | 2018.04.01;bateskevin;Creation. 22 | .LINK 23 | https://github.com/Stephanevg/PSHTML 24 | #> 25 | [CmdletBinding()] 26 | Param( 27 | 28 | [Parameter(Mandatory = $false, position = 0)] 29 | [AllowEmptyString()] 30 | [AllowNull()] 31 | $Content, 32 | 33 | [Parameter(Position = 1)] 34 | [String]$Class, 35 | 36 | [Parameter(Position = 2)] 37 | [String]$Id, 38 | 39 | [Parameter(Position = 3)] 40 | [String]$Style, 41 | 42 | [Parameter(Position = 4)] 43 | [Hashtable]$Attributes, 44 | 45 | [Parameter(Position = 5)] 46 | [string]$start 47 | 48 | ) 49 | Process { 50 | 51 | $tagname = "dl" 52 | 53 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType nonVoid 54 | 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /Code/Functions/Public/doctype.ps1: -------------------------------------------------------------------------------- 1 | Function doctype { 2 | <# 3 | .SYNOPSIS 4 | Generates a html doctype tag. 5 | 6 | .DESCRIPTION 7 | 8 | The declaration must be the very first thing in your HTML document, before the tag. 9 | 10 | The declaration is not an HTML tag; it is an instruction to the web browser about what version of HTML the page is written in. 11 | 12 | 13 | 14 | .EXAMPLE 15 | 16 | doctype 17 | 18 | .NOTES 19 | Current version 0.1.0 20 | History: 21 | 2019.07.09;@stephanevg;created 22 | 23 | .LINK 24 | https://github.com/Stephanevg/PSHTML 25 | #> 26 | 27 | Param( 28 | 29 | ) 30 | 31 | #As described here: https://www.w3schools.com/tags/tag_doctype.asp 32 | #$tagname = "doctype" 33 | 34 | #Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType 'void' 35 | return "" 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Code/Functions/Public/dt.ps1: -------------------------------------------------------------------------------- 1 | Function dt { 2 | <# 3 | .SYNOPSIS 4 | Create a dt tag in an HTML document. 5 | 6 | .EXAMPLE 7 | 8 | dt 9 | .EXAMPLE 10 | dt "woop1" -Class "class" 11 | 12 | .EXAMPLE 13 | dt "woop2" -Class "class" -Id "Something" 14 | 15 | .EXAMPLE 16 | dt "woop3" -Class "class" -Id "something" -Style "color:red;" 17 | 18 | .NOTES 19 | Current version 3.1 20 | History: 21 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 22 | 2018.10.02;bateskevin;Updated to v2. 23 | 2018.04.01;bateskevin;Creation. 24 | .LINK 25 | https://github.com/Stephanevg/PSHTML 26 | #> 27 | [Cmdletbinding()] 28 | Param( 29 | [Parameter(Mandatory = $true)] 30 | [AllowEmptyString()] 31 | [AllowNull()] 32 | $Content, 33 | 34 | [AllowEmptyString()] 35 | [AllowNull()] 36 | [String]$Class = "", 37 | 38 | [String]$Id, 39 | 40 | [AllowEmptyString()] 41 | [AllowNull()] 42 | [String]$Style, 43 | 44 | [String]$value, 45 | 46 | [Hashtable]$Attributes 47 | ) 48 | 49 | Process { 50 | $tagname = "dt" 51 | 52 | 53 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType nonVoid 54 | 55 | 56 | } 57 | } -------------------------------------------------------------------------------- /Code/Functions/Public/em.ps1: -------------------------------------------------------------------------------- 1 | Function em { 2 | <# 3 | .SYNOPSIS 4 | Generates em HTML tag. 5 | 6 | .Description 7 | This tag is a phrase tag. It renders as emphasized text. 8 | 9 | .EXAMPLE 10 | p{ 11 | "This is";em {"cool"} 12 | } 13 | 14 | Will generate the following code 15 | 16 |

17 | This is 18 | 19 | cool 20 | 21 |

22 | 23 | .Notes 24 | Author: Andrew Wickham 25 | Version: 3.1.0 26 | History: 27 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 28 | 2018.10.04;@awickham10; Creation 29 | 30 | .LINK 31 | https://github.com/Stephanevg/PSHTML 32 | #> 33 | [CmdletBinding()] 34 | Param( 35 | 36 | [Parameter( 37 | ValueFromPipeline = $true, 38 | Position = 0 39 | )] 40 | $Content, 41 | 42 | [Parameter(Position = 1)] 43 | [String]$Class, 44 | 45 | [Parameter(Position = 2)] 46 | [String]$Id, 47 | 48 | [Parameter(Position = 3)] 49 | [String]$Style, 50 | 51 | [Parameter(Position = 4)] 52 | [Hashtable]$Attributes 53 | 54 | ) 55 | 56 | $tagname = "em" 57 | 58 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType NonVoid 59 | 60 | 61 | 62 | } -------------------------------------------------------------------------------- /Code/Functions/Public/fieldset.ps1: -------------------------------------------------------------------------------- 1 | Function fieldset { 2 | <# 3 | .SYNOPSIS 4 | Create a fieldset title in an HTML document. 5 | 6 | .EXAMPLE 7 | 8 | fieldset 9 | .EXAMPLE 10 | fieldset "woop1" -Class "class" 11 | 12 | .EXAMPLE 13 | $css = @" 14 | "p {color:green;} 15 | h1 {color:orange;}" 16 | "@ 17 | fieldset {$css} -media "print" -type "text/css" 18 | 19 | .Notes 20 | Author: Stéphane van Gulick 21 | Version: 3.1 22 | History: 23 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 24 | 2018.05.09;@Stephanevg; Creation 25 | .LINK 26 | https://github.com/Stephanevg/PSHTML 27 | #> 28 | [Cmdletbinding()] 29 | Param( 30 | [Parameter(Mandatory = $false)] 31 | [AllowEmptyString()] 32 | [AllowNull()] 33 | $Content, 34 | 35 | [switch]$disabled, 36 | 37 | [String]$form, 38 | 39 | [String]$name, 40 | 41 | [AllowEmptyString()] 42 | [AllowNull()] 43 | [String]$Class, 44 | 45 | [String]$Id, 46 | 47 | [Hashtable]$Attributes 48 | ) 49 | 50 | 51 | $tagname = "fieldset" 52 | 53 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType nonVoid 54 | 55 | 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /Code/Functions/Public/figcaption.ps1: -------------------------------------------------------------------------------- 1 | Function figcaption { 2 | <# 3 | .SYNOPSIS 4 | Create a figcaption tag in an HTML document. 5 | 6 | .EXAMPLE 7 | 8 | figcaption 9 | .EXAMPLE 10 | figcaption "woop1" -Class "class" 11 | 12 | .EXAMPLE 13 | figcaption "woop2" -Class "class" -Id "Something" 14 | 15 | .EXAMPLE 16 | figcaption "woop3" -Class "class" -Id "something" -Style "color:red;" 17 | 18 | .NOTES 19 | Current version 3.1.0 20 | History: 21 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 22 | 2018.10.02;bateskevin;Updated to v2. 23 | 2018.04.01;bateskevin;Creation. 24 | .LINK 25 | https://github.com/Stephanevg/PSHTML 26 | #> 27 | [Cmdletbinding()] 28 | Param( 29 | [Parameter(Mandatory = $true)] 30 | [AllowEmptyString()] 31 | [AllowNull()] 32 | $Content, 33 | 34 | [AllowEmptyString()] 35 | [AllowNull()] 36 | [String]$Class = "", 37 | 38 | [String]$Id, 39 | 40 | [AllowEmptyString()] 41 | [AllowNull()] 42 | [String]$Style, 43 | 44 | [String]$title, 45 | 46 | [Hashtable]$Attributes 47 | ) 48 | 49 | Process { 50 | 51 | $tagname = "figcaption" 52 | 53 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType nonVoid 54 | 55 | } 56 | } -------------------------------------------------------------------------------- /Code/Functions/Public/figure.ps1: -------------------------------------------------------------------------------- 1 | Function figure { 2 | <# 3 | .SYNOPSIS 4 | Generates a figure HTML tag. 5 | 6 | .EXAMPLE 7 | The following exapmles show cases how to create an empty figure, with a class, an ID, and, custom attributes. 8 | figure -Class "myclass1 MyClass2" -Id myid -Attributes @{"custom1"='val1';custom2='val2'} 9 | 10 | Generates the following code: 11 | 12 |
13 |
14 | 15 | 16 | .NOTES 17 | Current version 3.1 18 | History: 19 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 20 | 2018.10.02;bateskevin;Updated to v2. 21 | 2018.04.01;bateskevin;Creation. 22 | .LINK 23 | https://github.com/Stephanevg/PSHTML 24 | #> 25 | 26 | Param( 27 | 28 | [Parameter( 29 | ValueFromPipeline = $true, 30 | Mandatory = $false, 31 | Position = 0 32 | )] 33 | $Content, 34 | 35 | [Parameter(Position = 1)] 36 | [String]$Class, 37 | 38 | [Parameter(Position = 2)] 39 | [String]$Id, 40 | 41 | [Parameter(Position = 3)] 42 | [String]$Style, 43 | 44 | [Parameter(Position = 4)] 45 | [Hashtable]$Attributes 46 | ) 47 | Process { 48 | 49 | $tagname = "figure" 50 | 51 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType nonVoid 52 | 53 | } 54 | } -------------------------------------------------------------------------------- /Code/Functions/Public/h1.ps1: -------------------------------------------------------------------------------- 1 | Function H1 { 2 | <# 3 | .SYNOPSIS 4 | Create a h1 title in an HTML document. 5 | 6 | .EXAMPLE 7 | 8 | h1 9 | .EXAMPLE 10 | h1 "woop1" -Class "class" 11 | 12 | .EXAMPLE 13 | h1 "woop2" -Class "class" -Id "MainTitle" 14 | 15 | .EXAMPLE 16 | h1 {"woop3"} -Class "class" -Id "MaintTitle" -Style "color:red;" 17 | 18 | .Notes 19 | Author: Stéphane van Gulick 20 | Version: 3.1.0 21 | History: 22 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 23 | 2018.04.08;Stephanevg; Updated to version 1.0: Updated content block to support string & ScriptBlock 24 | 2018.04.08;Stephanevg; Fixed custom Attributes display bug. Updated help 25 | 2018.03.25;@Stephanevg; Added Styles, ID, CLASS attributes functionality 26 | 2018.03.25;@Stephanevg; Creation 27 | .LINK 28 | https://github.com/Stephanevg/PSHTML 29 | #> 30 | [Cmdletbinding()] 31 | Param( 32 | [Parameter(Mandatory = $false)] 33 | [AllowEmptyString()] 34 | [AllowNull()] 35 | $Content, 36 | 37 | [AllowEmptyString()] 38 | [AllowNull()] 39 | [String]$Class, 40 | 41 | [String]$Id, 42 | 43 | [AllowEmptyString()] 44 | [AllowNull()] 45 | [String]$Style, 46 | 47 | [Hashtable]$Attributes 48 | ) 49 | 50 | Process { 51 | $tagname = "h1" 52 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType nonVoid 53 | } 54 | } -------------------------------------------------------------------------------- /Code/Functions/Public/h2.ps1: -------------------------------------------------------------------------------- 1 | Function h2 { 2 | <# 3 | .SYNOPSIS 4 | Create a h2 title in an HTML document. 5 | 6 | .EXAMPLE 7 | 8 | h2 9 | .EXAMPLE 10 | h2 "woop1" -Class "class" 11 | 12 | .EXAMPLE 13 | h2 "woop2" -Class "class" -Id "MainTitle" 14 | 15 | .EXAMPLE 16 | h2 {"woop3"} -Class "class" -Id "MaintTitle" -Style "color:red;" 17 | 18 | .Notes 19 | Author: Stéphane van Gulick 20 | Version: 3.1.0 21 | History: 22 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 23 | 2018.04.08;Stephanevg; Updated to version 1.0: Updated content block to support string & ScriptBlock 24 | 2018.03.25;@Stephanevg; Creation 25 | .LINK 26 | https://github.com/Stephanevg/PSHTML 27 | #> 28 | [Cmdletbinding()] 29 | Param( 30 | [Parameter(Mandatory = $false)] 31 | [AllowEmptyString()] 32 | [AllowNull()] 33 | $Content, 34 | 35 | [AllowEmptyString()] 36 | [AllowNull()] 37 | [String]$Class, 38 | 39 | [String]$Id, 40 | 41 | [AllowEmptyString()] 42 | [AllowNull()] 43 | [String]$Style, 44 | 45 | [Hashtable]$Attributes 46 | ) 47 | 48 | Process { 49 | $tagname = "h2" 50 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType nonVoid 51 | } 52 | } -------------------------------------------------------------------------------- /Code/Functions/Public/h3.ps1: -------------------------------------------------------------------------------- 1 | Function h3 { 2 | <# 3 | .SYNOPSIS 4 | Create a h3 title in an HTML document. 5 | 6 | .EXAMPLE 7 | 8 | h3 9 | .EXAMPLE 10 | h3 "woop1" -Class "class" 11 | 12 | .EXAMPLE 13 | h3 "woop2" -Class "class" -Id "MainTitle" 14 | 15 | .EXAMPLE 16 | h3 {"woop3"} -Class "class" -Id "MaintTitle" -Style "color:red;" 17 | 18 | .Notes 19 | Author: Stéphane van Gulick 20 | Version: 3.1.0 21 | History: 22 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 23 | 2018.04.08;Stephanevg; Updated to version 1.0: Updated content block to support string & ScriptBlock 24 | 2018.03.25;@Stephanevg; Creation 25 | .LINK 26 | https://github.com/Stephanevg/PSHTML 27 | #> 28 | [Cmdletbinding()] 29 | Param( 30 | [Parameter(Mandatory = $false)] 31 | [AllowEmptyString()] 32 | [AllowNull()] 33 | $Content, 34 | 35 | [AllowEmptyString()] 36 | [AllowNull()] 37 | [String]$Class, 38 | 39 | [String]$Id, 40 | 41 | [AllowEmptyString()] 42 | [AllowNull()] 43 | [String]$Style, 44 | 45 | [Hashtable]$Attributes 46 | ) 47 | 48 | Process { 49 | $tagname = "h3" 50 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType nonVoid 51 | } 52 | } -------------------------------------------------------------------------------- /Code/Functions/Public/h4.ps1: -------------------------------------------------------------------------------- 1 | Function h4 { 2 | <# 3 | .SYNOPSIS 4 | Create a h4 title in an HTML document. 5 | 6 | .EXAMPLE 7 | 8 | h4 9 | .EXAMPLE 10 | h4 "woop1" -Class "class" 11 | 12 | .EXAMPLE 13 | h4 "woop2" -Class "class" -Id "MainTitle" 14 | 15 | .EXAMPLE 16 | h4 {"woop3"} -Class "class" -Id "MaintTitle" -Style "color:red;" 17 | 18 | .Notes 19 | Author: Stéphane van Gulick 20 | Version: 3.1.0 21 | History: 22 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 23 | 2018.04.08;Stephanevg; Updated to version 1.0: Updated content block to support string & ScriptBlock 24 | 2018.03.25;@Stephanevg; Creation 25 | .LINK 26 | https://github.com/Stephanevg/PSHTML 27 | #> 28 | [Cmdletbinding()] 29 | Param( 30 | [Parameter(Mandatory = $false)] 31 | [AllowEmptyString()] 32 | [AllowNull()] 33 | $Content, 34 | 35 | [AllowEmptyString()] 36 | [AllowNull()] 37 | [String]$Class, 38 | 39 | [String]$Id, 40 | 41 | [AllowEmptyString()] 42 | [AllowNull()] 43 | [String]$Style, 44 | 45 | [Hashtable]$Attributes 46 | ) 47 | 48 | Process { 49 | $tagname = "h4" 50 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType nonVoid 51 | } 52 | } -------------------------------------------------------------------------------- /Code/Functions/Public/h5.ps1: -------------------------------------------------------------------------------- 1 | Function h5 { 2 | <# 3 | .SYNOPSIS 4 | Create a h5 title in an HTML document. 5 | 6 | .EXAMPLE 7 | 8 | h5 9 | .EXAMPLE 10 | h5 "woop1" -Class "class" 11 | 12 | .EXAMPLE 13 | h5 "woop2" -Class "class" -Id "MainTitle" 14 | 15 | .EXAMPLE 16 | h5 {"woop3"} -Class "class" -Id "MaintTitle" -Style "color:red;" 17 | 18 | .Notes 19 | Author: Stéphane van Gulick 20 | Version: 3.1.0 21 | History: 22 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 23 | 2018.04.08;Stephanevg; Updated to version 1.0: Updated content block to support string & ScriptBlock 24 | 2018.03.25;@Stephanevg; Creation 25 | .LINK 26 | https://github.com/Stephanevg/PSHTML 27 | #> 28 | [Cmdletbinding()] 29 | Param( 30 | [Parameter(Mandatory = $false)] 31 | [AllowEmptyString()] 32 | [AllowNull()] 33 | $Content, 34 | 35 | [AllowEmptyString()] 36 | [AllowNull()] 37 | [String]$Class, 38 | 39 | [String]$Id, 40 | 41 | [AllowEmptyString()] 42 | [AllowNull()] 43 | [String]$Style, 44 | 45 | [Hashtable]$Attributes 46 | ) 47 | 48 | Process { 49 | $tagname = "h5" 50 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType nonVoid 51 | } 52 | } -------------------------------------------------------------------------------- /Code/Functions/Public/h6.ps1: -------------------------------------------------------------------------------- 1 | Function h6 { 2 | <# 3 | .SYNOPSIS 4 | Create a h6 title in an HTML document. 5 | 6 | .EXAMPLE 7 | 8 | h6 9 | .EXAMPLE 10 | h6 "woop1" -Class "class" 11 | 12 | .EXAMPLE 13 | h6 "woop2" -Class "class" -Id "MainTitle" 14 | 15 | .EXAMPLE 16 | h6 {"woop3"} -Class "class" -Id "MaintTitle" -Style "color:red;" 17 | 18 | .Notes 19 | Author: Stéphane van Gulick 20 | Version: 3.1.0 21 | History: 22 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 23 | 2018.04.08;Stephanevg; Updated to version 1.0: Updated content block to support string & ScriptBlock 24 | 2018.03.25;@Stephanevg; Creation 25 | .LINK 26 | https://github.com/Stephanevg/PSHTML 27 | #> 28 | [Cmdletbinding()] 29 | Param( 30 | [Parameter(Mandatory = $false)] 31 | [AllowEmptyString()] 32 | [AllowNull()] 33 | $Content, 34 | 35 | [AllowEmptyString()] 36 | [AllowNull()] 37 | [String]$Class, 38 | 39 | [String]$Id, 40 | 41 | [AllowEmptyString()] 42 | [AllowNull()] 43 | [String]$Style, 44 | 45 | [Hashtable]$Attributes 46 | ) 47 | 48 | Process { 49 | $tagname = "h6" 50 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType nonVoid 51 | } 52 | } -------------------------------------------------------------------------------- /Code/Functions/Public/hr.ps1: -------------------------------------------------------------------------------- 1 | Function hr { 2 | <# 3 | .SYNOPSIS 4 | Create a hr title in an HTML document. 5 | 6 | .EXAMPLE 7 | 8 | hr 9 | 10 | #Generates the following code: 11 | 12 |
13 | 14 | .EXAMPLE 15 | 16 | hr -Attributes @{"Attribute1"="val1";"Attribute2"="val2"} 17 | 18 | Generates the following code 19 | 20 |
21 | 22 | .EXAMPLE 23 | 24 | $Style = "font-family: arial; text-align: center;" 25 | hr -Style $style 26 | 27 | Generates the following code 28 | 29 |
30 | 31 | .Notes 32 | Author: Stéphane van Gulick 33 | Version: 2.0.0 34 | History: 35 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 36 | 2018.04.08;bateskevin; Updated to v2.0 37 | 2018.04.08;Stephanevg; Updated to version 1.0: Updated content block to support string & ScriptBlock 38 | 2018.03.25;@Stephanevg; Added Styles, ID, CLASS attributes functionality 39 | 2018.03.25;@Stephanevg; Creation 40 | .LINK 41 | https://github.com/Stephanevg/PSHTML 42 | #> 43 | [Cmdletbinding()] 44 | Param( 45 | 46 | [AllowEmptyString()] 47 | [AllowNull()] 48 | [String]$Class, 49 | 50 | [String]$Id, 51 | 52 | [AllowEmptyString()] 53 | [AllowNull()] 54 | [String]$Style, 55 | 56 | [Hashtable]$Attributes 57 | ) 58 | 59 | Process { 60 | $tagname = "hr" 61 | 62 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType void 63 | 64 | } 65 | 66 | } -------------------------------------------------------------------------------- /Code/Functions/Public/i.ps1: -------------------------------------------------------------------------------- 1 | Function i { 2 | <# 3 | .SYNOPSIS 4 | 5 | Generates a HTML tag. 6 | The tag defines a hyperlink, which is used to link from one page to another. 7 | 8 | .DESCRIPTION 9 | 10 | .PARAMETER Class 11 | Allows to specify one (or more) class(es) to assign the html element. 12 | More then one class can be assigned by seperating them with a white space. 13 | 14 | .PARAMETER Id 15 | Allows to specify an id to assign the html element. 16 | 17 | .PARAMETER Content 18 | Allows to add child element(s) inside the current opening and closing HTML tag(s). 19 | 20 | 21 | .EXAMPLE 22 | The following exapmles show cases how to create an empty i, with a class, an ID, and, custom attributes. 23 | 24 | i -Class "myclass1 MyClass2" -Id myid -Attributes @{"custom1"='val1';custom2='val2'} 25 | 26 | Generates the following code: 27 | 28 | 29 | 30 | 31 | 32 | .NOTES 33 | Current version 3.1 34 | History: 35 | 2019.06.19;@Josh_Burkard;initial version 36 | .LINK 37 | https://github.com/Stephanevg/PSHTML 38 | #> 39 | 40 | Param( 41 | 42 | [Parameter(Mandatory = $false)] 43 | [AllowEmptyString()] 44 | [AllowNull()] 45 | $Content, 46 | 47 | [AllowEmptyString()] 48 | [AllowNull()] 49 | [String]$Class, 50 | 51 | [String]$Id, 52 | 53 | [Hashtable]$Attributes 54 | 55 | ) 56 | $tagname = "i" 57 | 58 | Set-htmltag -TagName $tagName -Parameters $PSBoundParameters -TagType NonVoid 59 | 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /Code/Functions/Public/keygen.ps1: -------------------------------------------------------------------------------- 1 | Function Keygen { 2 | <# 3 | .SYNOPSIS 4 | Create a Keygen tag in an HTML document. 5 | 6 | .DESCRIPTION 7 | 8 | The name attribute specifies the name of a element. 9 | 10 | The name attribute of the element is used to reference form data after the form has been submitted. 11 | 12 | .EXAMPLE 13 | 14 | keygen -Name "Secure" 15 | 16 | Returns: 17 | 18 | 19 | 20 | .NOTES 21 | Current version 3.1 22 | History: 23 | 2018.10.30;@ChristopheKumor;Updated to version 3.0 24 | 2018.10.10;Stephanevg;Creation. 25 | .LINK 26 | https://github.com/Stephanevg/PSHTML 27 | #> 28 | [Cmdletbinding()] 29 | Param( 30 | 31 | [AllowEmptyString()] 32 | [AllowNull()] 33 | [String]$Name = "", 34 | 35 | [AllowEmptyString()] 36 | [AllowNull()] 37 | [String]$Class = "", 38 | 39 | [String]$Id, 40 | 41 | [AllowEmptyString()] 42 | [AllowNull()] 43 | [String]$Style, 44 | 45 | [String]$title, 46 | 47 | [Hashtable]$Attributes 48 | ) 49 | 50 | Process { 51 | $tagname = "Keygen" 52 | 53 | Set-HtmlTag -TagName $tagname -Parameters $PSBoundParameters -TagType Void 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Code/Functions/Public/label.ps1: -------------------------------------------------------------------------------- 1 | Function label { 2 | <# 3 | .SYNOPSIS 4 | Creates a