A cross-platform, minimalist web framework for PowerShell - https://www.powershellgallery.com/packages/Polaris
acc (discord)
the "Not found (Not Found)" thing in browser definitely seems to be proxy related because of course, as you can see, sending a get req locally on the box is fine. and also browsing to it locally http://localhost:8080 in chrome or something shows the response i configured for the route
acc (discord)
btw, this is the route I'm usingNew-PolarisRoute -Method GET -Path "/" -ScriptBlock {
$Response.Send('Hello World!')
}
tiberriver256 (slack)
@ddmee - The default logger just uses Write-Host so the logs go poof if you don't override the logger.
```It "Allows a custom logger" {
$Port = Get-Random -Minimum 8000 -Maximum 8999
$Polaris = Start-Polaris -Port $Port
$Polaris.Logger = {
param($LogString)
$Word | Out-File "TestDrive:\test.log" -NoNewline
}
$Polaris.Log("Hello")
Get-Content "TestDrive:\test.log" -Raw | Should be "Hello"
} ```
tiberriver256 (slack)
The built-in logging is pretty rudimentary though. grtswt just put in an issue to discuss standardization: PowerShell/Polaris#205
tiberriver256 (slack)
What's your Start-Polaris command look like?
tiberriver256 (slack)
If you're using the latest from the Github repo (@tyler) is working on getting it published out to the gallery you should also specify the hostname you want Polaris to listen on like:$app = Start-Polaris -Hostname $Hostname -Port $portToUse -MinRunspaces 1 -MaxRunspaces 5 -UseJsonBodyParserMiddleware -Verbose # all params are optional
tiberriver256 (slack)
Otherwise if you're using the version from the gallery I believe you have to run it as admin to get it to listen on something other than localhost
tiberriver256 (slack)
You can check for sure what hostname it's listening on by doing:(get-polaris).Listener.Prefixes
tiberriver256 (slack)
If you don't want to update and you don't want to run as administrator you can do:$app = Start-Polaris -Hostname $Hostname -Port $portToUse -MinRunspaces 1 -MaxRunspaces 5 -UseJsonBodyParserMiddleware -Verbose # all params are optional
$app.Listener.Prefixes.Add("http://myhostname.mydomain.com")
tiberriver256 (slack)
It should print the full url like: http://pstvman.westus2.cloudapp.azure.com
tiberriver256 (slack)
If you need https there's some good tips on this issue for setting it up:
PowerShell/Polaris#107
Still open issue to get it into the docs
lxlechat (slack)
if you have a litle money, you should try UniversalDashboard
tiberriver256 (slack)
@joerod - Just updated the docs with the new authentication guide that explains it:
https://powershell.github.io/Polaris/docs/about_Authentication.html
tl;dr $Request.User.IsInRole('Administrators')
is how you check to see if the authenticated user is in a particular security group
tiberriver256 (slack)
Putting it behind a reverse proxy should be similar to putting Node.js or something else behind a reverse proxy. Introducing a reverse proxy inherently brings a few limitations but Polaris (or any other web server) wouldn't really have any way to know it's behind a reverse proxy or be able to behave any differently. It should just work. I haven't seen any blog posts on anyone using it behind IIS reverse proxy yet though.
tiberriver256 (slack)
Never merged it because I was going to clean up grammatical errors but I believe this was a technically valid explanation of getting Kerberos working w/ Polaris if you want to check it out and see if it works for you.
ashishcw (discord)
So, trying to install on PS 4.0 with git repo(psd) file.
ashishcw (discord)
but it's giving an error.
ashishcw (discord)
can anyone please point me in the right direction, as where can I find a documentation or how to guide?
ashishcw (discord)
So, I updated my $PSVersion
ashishcw (discord)
however I am still unable to get this thing working.
ashishcw (discord)
what am I doing wrong here?
ashishcw (discord)
any clue? someone?
Peter Wawa (slack)
if you want to load the module from local path, use Import-Module
with path to .psd1 file
🌸Joel🌸 (discord)
@ashishcw looks like a TLS issue
🌸Joel🌸 (discord)
try running this and then run the install again:[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
tiberriver256 (slack)
Install-Module will download it from PowerShell Gallery, which we haven't been able to get a new version out to in quite awhile. If you want to use the latest from the code repo use the import-module ./Polaris.psd1
method.