You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Have a light weight PowerShell client that can be used to manage remote endpoints #4096
We should be able to have a lightweight client library/host that is solely for managing remote PowerShell endpoints. This means that the parser, etc... is not on the client.
Reacted by Ben Lavender, Patrick Meinecke, Joel Bennett, Drew Burt, Chris Gardner, rschaeferhig, Stuart Moore, Stephane Tombeur, Shawn Melton, Daniel Schroeder and 4 more
The client should understand both WSMan and SSH PSRP. Pure SSH should be existing solutions. For a library, I wonder if it's better to just enable a basic REST endpoint to execute PowerShell and get back JSON which means many existing languages can easily work with PowerShell remotely or if there is a real need for apps to talk PSRP.
Reacted by Ilya, Wojciech Sciesinski and Thomas Nieto
Some or all "core" cmdlets should be exposed as endpoints that accept parameters as queries /api/v1.0/Cmdlets/Get-Process?Name=pwsh == Get-Process -Name pwsh
The same endpoint without a cmdlet should list available cmdlets /api/v1.0/Cmdlets/ lists available cmdlets and parameters
the cmdlet endpoints should accept a json object body that contains a object with a Parameters property that is an array of objects containing paramters to execute.. /api/v1.0/Cmdlets/Get-Process accepts the body {"Parameters":[{"Name":"pwsh"},{"Id":1234}]} and executes Get-Process -Name pwsh; Get-Process -d 12345
There should be and endpoint that takes general cmds /api/v1.0/Command takes a body with something like {"Commands":["$ProcessName = \"pwsh\"","Get-Process -Name $ProcessName"]} which executes $ProcessName = "pwsh"; Get-Process -Name $ProcessName
Results should some what mimic jobs where the output streams are sepertaed.
There should be a modules endpoint which lists the available modules and any exposed endpoints
modules endpoint should possibly be allowed to install and uninstall modules
Piping objects should be done though a JSON body.. not really sure on this one.. might only work on ValueFromPipelineByPropertyName?? *shrugs
and $SessionId query should be available on all endpoints to identify a PowerShell session the cmds are run in and response header should include session expiry date. Variables and such should persist in that session until expiry, expiry clock resets after every execution, session expiry time is configurable, session should be tied current auth, a single auth can have multiple session, thus requiring a session edpoint to reqeust manage sessions.... API calls with out $SessionID could either run in a one off session or against a default session...
Its fair to say I have given this some thought before....
Reacted by Charlie Schmidt, thomasbruggink and Thomas Nieto
Mark Kraus (@markekraus) 😄 I only ask your opinion not full specifications. Thanks for great comment. I think it is better to move this in new Issue. Steve Lee (@SteveL-MSFT) Perhaps it makes sense to ask MSFT product teams to give feedback about PowerShell REST endpoint. I know Exchange Server team is actively using PowerShell over HTTPS (EMS).
I, for one, definitely don't want a REST endpoint.
I already have PowerShell remoting and constrained endpoints, etc. I don't need a replacement server product -- I need client libraries to call the PowerShell remoting endpoints I already have.
For what it's worth, we have web apps that currently make PowerShell remoting calls, and as we're moving things to ASP.NET Core, we still need to be able to do PowerShell remoting (including from containers). I just don't want (to need) to ship a whole copy of all of PowerShell's dependencies for that.
I mean, I'm sure that a PowerShell REST endpoint would be awesome, but it's change on the wrong end, for me...
The REST discussion deviated from the original topic (yes, I did that!). Let's focus discussion of this issue on a client library to remotely manage existing PowerShell endpoints.
Wojciech Sciesinski (@it-praktyk) from the original topic probably not. We use our own Python client(s) and talk to the server. Having a REST endpoint is interesting but we currently don't have any plans on officially supporting PSCore in the short term which is what will be affected by this.
Jordan Borean (@jborean93) well, the client library would be .NET Standard, but it has to be able to talk to either Windows PowerShell or PowerShell Core endpoints. It would basically be a .NET version of the Python client, so we can finally catch up 😬
Joel Bennett (@Jaykul) agreed, technically on the Windows side you have winrs which allows you to run commands over WinRM outside of PSRP but that's Windows specific.
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 23, 2023
Activity
iSazonov commentedon Jan 13, 2018
We could start with two separated clients - 1. PSRP 2. SSH
If I understand right we need simple console app to setup remote session and run remote PowerShell process.
SteveL-MSFT commentedon Jan 17, 2018
The client should understand both WSMan and SSH PSRP. Pure SSH should be existing solutions. For a library, I wonder if it's better to just enable a basic REST endpoint to execute PowerShell and get back JSON which means many existing languages can easily work with PowerShell remotely or if there is a real need for apps to talk PSRP.
iSazonov commentedon Jan 17, 2018
Mark Kraus (@markekraus) Have you thoughts about PowerShell REST endpoint?
markekraus commentedon Jan 17, 2018
Kind of...
/api/v1.0/Cmdlets/Get-Process?Name=pwsh==Get-Process -Name pwsh/api/v1.0/Cmdlets/lists available cmdlets and parametersParametersproperty that is an array of objects containing paramters to execute../api/v1.0/Cmdlets/Get-Processaccepts the body{"Parameters":[{"Name":"pwsh"},{"Id":1234}]}and executesGet-Process -Name pwsh; Get-Process -d 12345/api/v1.0/Commandtakes a body with something like{"Commands":["$ProcessName = \"pwsh\"","Get-Process -Name $ProcessName"]}which executes$ProcessName = "pwsh"; Get-Process -Name $ProcessNameValueFromPipelineByPropertyName?? *shrugs$SessionIdquery should be available on all endpoints to identify a PowerShell session the cmds are run in and response header should include session expiry date. Variables and such should persist in that session until expiry, expiry clock resets after every execution, session expiry time is configurable, session should be tied current auth, a single auth can have multiple session, thus requiring a session edpoint to reqeust manage sessions.... API calls with out$SessionIDcould either run in a one off session or against a default session...Its fair to say I have given this some thought before....
iSazonov commentedon Jan 17, 2018
Mark Kraus (@markekraus) 😄 I only ask your opinion not full specifications. Thanks for great comment. I think it is better to move this in new Issue.
Steve Lee (@SteveL-MSFT) Perhaps it makes sense to ask MSFT product teams to give feedback about PowerShell REST endpoint. I know Exchange Server team is actively using PowerShell over HTTPS (EMS).
SteveL-MSFT commentedon Jan 18, 2018
Mark Kraus (@markekraus) perhaps you can author an RFC :)
Jaykul commentedon Oct 18, 2018
I, for one, definitely don't want a REST endpoint.
I already have PowerShell remoting and constrained endpoints, etc. I don't need a replacement server product -- I need client libraries to call the PowerShell remoting endpoints I already have.
For what it's worth, we have web apps that currently make PowerShell remoting calls, and as we're moving things to ASP.NET Core, we still need to be able to do PowerShell remoting (including from containers). I just don't want (to need) to ship a whole copy of all of PowerShell's dependencies for that.
I mean, I'm sure that a PowerShell REST endpoint would be awesome, but it's change on the wrong end, for me...
SteveL-MSFT commentedon Oct 18, 2018
The REST discussion deviated from the original topic (yes, I did that!). Let's focus discussion of this issue on a client library to remotely manage existing PowerShell endpoints.
it-praktyk commentedon Oct 18, 2018
Matt Davis (@nitzmahone), Jordan Borean (@jborean93), is it something that can be used by Ansible to manage Windows?
jborean93 commentedon Oct 18, 2018
Wojciech Sciesinski (@it-praktyk) from the original topic probably not. We use our own Python client(s) and talk to the server. Having a REST endpoint is interesting but we currently don't have any plans on officially supporting PSCore in the short term which is what will be affected by this.
Jaykul commentedon Oct 18, 2018
Jordan Borean (@jborean93) well, the client library would be .NET Standard, but it has to be able to talk to either Windows PowerShell or PowerShell Core endpoints. It would basically be a .NET version of the Python client, so we can finally catch up 😬
jborean93 commentedon Oct 18, 2018
Joel Bennett (@Jaykul) agreed, technically on the Windows side you have
winrswhich allows you to run commands over WinRM outside of PSRP but that's Windows specific.kilasuit commentedon Jul 20, 2022
this is also linked to #5681
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 23, 2023
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.