Skip to content

Instantly share code, notes, and snippets.

@adamdriscoll
Created October 2, 2019 17:29
Show Gist options
  • Save adamdriscoll/eb1a48c8396d53e62b8a9ac84f55d0bd to your computer and use it in GitHub Desktop.
Save adamdriscoll/eb1a48c8396d53e62b8a9ac84f55d0bd to your computer and use it in GitHub Desktop.
Using PSWriteHtml and Universal Dashboard
Import-Module PSWriteHTML
New-HTML -TitleText 'My diagram' -UseCssLinks -UseJavaScriptLinks -FilePath $PSScriptRoot\pswritehtml\diagram.html {
New-HTMLPanel {
New-HTMLDiagram {
New-DiagramNode -Label 'One node' -To 'Second node','Third node' -ColorBackground Bisque
New-DiagramNode -Label 'Second node'
New-DiagramNode -Label 'Third node'
}
}
}
$Folder = Publish-UDFolder -Path "$PSScriptRoot/pswritehtml" -RequestPath "/pswritehtml"
Start-UDDashboard -Dashboard (New-UDDashboard -Title 'Dashboard' -Content {
New-UDElement -Tag 'iframe' -Attributes @{
style = @{
height = '100ch'
width = '100%'
}
src = "/pswritehtml/diagram.html"
}
}) -Port 10000 -Force -PublishedFolder $Folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment