Last active
September 7, 2021 07:42
-
-
Save Stephanevg/09a5e5fabaa528b997b180fd6d042fd8 to your computer and use it in GitHub Desktop.
Generate a HTML page with drop down boxes using PSHTML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import-module C:\Users\taavast3\OneDrive\Repo\Projects\OpenSource\PSHTML\pshtml.psd1 | |
| $Languages = @("PowerShell","Ruby","CSharp","Python") | |
| $HtmlDocument = html { | |
| head{ | |
| title "woop title" | |
| link -rel "stylesheet" "css/normalize.css" | |
| } | |
| body{ | |
| Header { | |
| h1 "My select page" | |
| div { | |
| p { | |
| "Hello from D.P" | |
| } | |
| } | |
| } | |
| p { | |
| "My favorite language is:" | |
| } | |
| SelectTag { | |
| foreach($language in $Languages){ | |
| option -value $language -Content $language | |
| } | |
| } | |
| p { | |
| "My favorite car is:" | |
| } | |
| SelectTag { | |
| option -value "Citroen" -Content "Citroen" | |
| option -value "Renault" -Content "Renault" | |
| option -value "Peugeot" -Content "Peugeot" | |
| option -value "DS" -Content "DS" | |
| } | |
| p { | |
| "My favorite language color:" | |
| } | |
| SelectTag { | |
| option -value "Gree" -Content "Green" | |
| option -value "Yellow" -Content "Yellow" | |
| option -value "White" -Content "White" | |
| option -value "Red" -Content "Red" | |
| } | |
| "<br>" | |
| "<br>" | |
| button -Content "To Next Page" -Id "btn_Next" | |
| } | |
| } | |
| $HtmlDocument > $home\Documents\MyPage.Html | |
| start $home\Documents\MyPage.Html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment