Skip to content

Instantly share code, notes, and snippets.

@Stephanevg
Created May 28, 2019 10:29
Show Gist options
  • Save Stephanevg/f8df25a7a01c8c0fca075098a10500bb to your computer and use it in GitHub Desktop.
Save Stephanevg/f8df25a7a01c8c0fca075098a10500bb to your computer and use it in GitHub Desktop.
Import-Module C:\Users\taavast3\OneDrive\Repo\Projects\OpenSource\PSHTML\PSHTML\PSHTML.psd1 -Force
Import-Module Polaris -Force
New-PolarisGetRoute "/" -Scriptblock {
$GroupName = "TestGroup"
$HTML = .\Routes\LocalUserView.ps1 -GroupName $GroupName
$Response.SetContentType('text/html')
$Response.Send($HTML)
} -Force
New-PolarisGetRoute "/LocalUserView" -Scriptblock {
$HTML = .\Routes\LocalUserView.ps1 -GroupName $GroupName
$Response.SetContentType('text/html')
$Response.Send($HTML)
} -Force
New-PolarisPostRoute "/removeuser" -Scriptblock {
$HTML = .\Routes\RemoveUser.ps1 -GroupName $GroupName
$Response.SetContentType('text/html')
$Response.Send($HTML)
} -Force
New-PolarisPostRoute "/adduser" -Scriptblock {
$HTML = .\Routes\AddUser.ps1 -GroupName $GroupName
$Response.SetContentType('text/html')
$Response.Send($HTML)
}
$App = Start-Polaris -Port 8080 -Verbose -UseJsonBodyParserMiddleware
$App
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment