Skip to content

Instantly share code, notes, and snippets.

@adamdriscoll
Created October 2, 2019 17:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamdriscoll/c70da47f6f0c9636135529190718ce8f to your computer and use it in GitHub Desktop.
Save adamdriscoll/c70da47f6f0c9636135529190718ce8f to your computer and use it in GitHub Desktop.
Combining Multiple PSHtml Elements into a Single String
$Html = (& {
h1 "This is h1 Title in header"
div {
p {
"This is simply a paragraph in a div."
}
h1 "This is h1"
h2 "This is h2"
h3 "This is h3"
h4 "This is h4"
h5 "This is h5"
h6 "This is h6"
strong "plop";"Woop"
}
h1 "My favorites Fruits"
$Fruits = "Apple","Banana","Orange","Ananas"
ul {
foreach($fruit in $Fruits){
li {
$fruit
}
}
}
}) -join ''
New-UDHtml -Markup $Html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment