Last active
September 7, 2021 07:45
-
-
Save Stephanevg/c9922985ccca8de004f9f3acc217991d to your computer and use it in GitHub Desktop.
To answer your case of having pshtml in functions
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
| Function Write-Header { | |
| $Header = | |
| Head{ | |
| '{0}' | |
| '{1}' | |
| }#end of header | |
| $Content1 = Title "Salutations!" | |
| $Content2 =script -src "MyScript.js" | |
| #$REturn = | |
| $Header -f $Content1,$Content2 | |
| return $REturn | |
| } | |
| Function Write-Body { | |
| $MyBody = div { | |
| h1 "Main Title" | |
| h2 "SubTitle" | |
| div -Class "Main" -Content { | |
| p { | |
| "plop wop wap" | |
| } | |
| P { | |
| "Paragraph 2" | |
| } | |
| } | |
| } | |
| $Body = Body{ | |
| '{0}' | |
| }#End of body | |
| $Body -f $MyBody | |
| } | |
| Function Write-Footer { | |
| $Content = div{ | |
| h1 "This is my title" | |
| p { | |
| "Woop" | |
| } | |
| } | |
| $HtmlContent = | |
| Footer{ | |
| '{0}' | |
| }#End of footer | |
| return $HtmlContent -f $Content | |
| } | |
| #your Script | |
| Html { | |
| Write-Header | |
| Write-Body | |
| Write-Footer | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment