Announcing PowerShell Information Server (PSIS)
Johan Akerstrom – PowerShell expert from Sweden – released a PowerShell module that can be used to start a PowerShell-based web server. He preferred to call it a PowerShell Information Server (PSIS). Although, I am not really sure about the name given to it, I completely love the concept and work he did.
This module is available on Github. It is very easy to use and work with.
Invoke-PSIS -URL "http://*:8087/" -AuthenticationSchemes negotiate -ProcessRequest { Write-Verbose $request.RequestBody Get-Service $request.RequestObject.ServiceName } -Verbose -Impersonate
This gets the web server started. The -ProcessRequest is what gets executed when a request arrives at the web server. So, in my example, I am just getting the service information.
We can call the end point we just started using the Invoke-RestMethod cmdlet.
$data = [pscustomobject]@{ ServiceName = "winmgmt" } $postData = $data | ConvertTo-Json Invoke-RestMethod -Method post -Uri 'http://localhost:8087/json' -UseDefaultCredentials -Body $postData | ConvertTo-Json
I already have a list of things I want to try. Go ahead and try the module and leave your feedback for Johan.
Share on: