Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    PowerShell Connect
    @PoshConnect_twitter
    sloomy (slack) i was assuming that if i use $response.send() the request is closed and the response is sent to the client. however, the code will continue to run. The result is that the last $ response.send is displayed as a result on the client side. how do I force the code to end the request before the end of the routine is reached?
    PowerShell Connect
    @PoshConnect_twitter
    sloomy (slack) see also PowerShell/Polaris#195
    PowerShell Connect
    @PoshConnect_twitter
    gregzon (slack) Hello
    gregzon (slack) Is it possible in Polaris to add some form of authentication ?
    gregzon (slack) i am looking at the documentation and i dont see anything mentioning that
    gregzon (slack) i see in the code [ValidateSet('Anonymous', 'Basic', 'Digest', 'IntegratedWindowsAuthentication', 'Negotiate', 'NTLM')] for auth
    gregzon (slack) but https://github.com/PowerShell/Polaris/blob/master/docs/Start-Polaris.md does not talk about this param
    gregzon (slack) and does anyone have any idea why when i do : start-polaris -port 8555 , and then, stop-polaris, and start-polaris -port 8555 , postman can't get reply ? i have to close powershell, and open it again and start polaris in order for it to work
    PowerShell Connect
    @PoshConnect_twitter
    ๐ŸŒธJoel๐ŸŒธ (discord) Probably Polaris is not disposing of its ports correctly
    PowerShell Connect
    @PoshConnect_twitter
    gregzon (slack) even if i start another with -port new_port it acts the s ame
    gregzon (slack) like hanging
    gregzon (slack) i also tried with Stop-Polaris -ServerContext
    gregzon (slack) same behaviour
    gregzon (slack) for the authentication i saw his
    gregzon (slack) and that does the trick, but i dont understand the part of the source code , where they say that there are
    gregzon (slack) Start-Polaris : Cannot validate argument on parameter 'Auth'. The argument "sdfs" does not belong to the set
    "Anonymous,Basic,Digest,IntegratedWindowsAuthentication,Negotiate,NTLM"
    gregzon (slack) so there are some authentination methods there, but not implemented ?
    Chen V
    @ChendrayanV_twitter
    AFAIK no authentication in Polaris, that's the reason i opted for basic auth and passing in headers. Similarly, we can choose bearer and go for timeouts for security.
    I mean no docs. Let me know if I can help u out in imementation
    Chen V
    @ChendrayanV_twitter
    For Polaris hanging issues are occurred mainly in
    Sorry for the above incorrect statement ๐Ÿ‘†
    What happens if u remove psreadline module and try? Polaris hangs?
    PowerShell Connect
    @PoshConnect_twitter
    acc (discord) Hey, I created a route with -Path "/" and trying to run it through reverse proxy. i've actually got nginx location directive watching out for /test and push a bunch of it to http://localhost:8080/ but the responses i'm getting are just "Not found (Not Found)"
    acc (discord) any tips? ๐Ÿ™‚
    PowerShell Connect
    @PoshConnect_twitter
    This message was deleted
    acc (discord) i can invoke-restmethod locally, but only if i interact with pwsh by pressing enter or something, let me share..
    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
    PowerShell Connect
    @PoshConnect_twitter
    acc (discord) maybe because powershell isn't "supported" with nginx? nginx/unit#112 (edited)
    acc (discord) btw, this is the route I'm using
    New-PolarisRoute -Method GET -Path "/" -ScriptBlock {
        $Response.Send('Hello World!')
    }
    Donal
    @ddmee
    Where can I see the logs that polaris writes?
    PowerShell Connect
    @PoshConnect_twitter

    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
    daver99
    @daver99
    HI -- anyone following this still?? I'm trying to get Polaris to be available on my Azure VM. I've opened ports and firewall, but I just get an Invalid Hostname. The same scripts run fine on machines in my office LAN. Any suggestions as to how to get this operational? I've set up a dns name in azure, it does resolve, running on port 8082, but the response is failing.
    PowerShell Connect
    @PoshConnect_twitter
    tiberriver256 (slack) Hey daver, I lurk here on occasion ๐Ÿ™‚
    tiberriver256 (slack) What's your Start-Polaris command look like?
    daver99
    @daver99
    $app = Start-Polaris -Port $portToUse -MinRunspaces 1 -MaxRunspaces 5 -UseJsonBodyParserMiddleware -Verbose # all params are optional
    PowerShell Connect
    @PoshConnect_twitter
    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
    PowerShell Connect
    @PoshConnect_twitter
    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")
    daver99
    @daver99
    I've got the latest ( I think) - it does take hostname. So if my azure vm is assigned postvman.westus2.cloudapp.azure.com
    Then I use that full name as the hostname param?
    (I'm running as admin)
    PowerShell Connect
    @PoshConnect_twitter
    tiberriver256 (slack) Yep, that's correct.
    daver99
    @daver99
    nice.. thank you very much -- trying now!
    PowerShell Connect
    @PoshConnect_twitter
    tiberriver256 (slack) If that doesn't work run (get-polaris).Listener.Prefixes and make sure the URL there looks like you would expect
    tiberriver256 (slack) It should print the full url like: http://pstvman.westus2.cloudapp.azure.com