Skip to content

Have a light weight PowerShell client that can be used to manage remote endpoints #4096

Closed

Description

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.

Activity

  1. added
    WG-Interactive-Console
    WG-Remoting
    on Jun 23, 2017
  2. iSazonov commented on Jan 13, 2018

    @iSazonov
    Collaborator

    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.

  3. SteveL-MSFT commented on Jan 17, 2018

    @SteveL-MSFT
    MemberAuthor

    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.

  4. iSazonov commented on Jan 17, 2018

    @iSazonov
    Collaborator

    Mark Kraus (@markekraus) Have you thoughts about PowerShell REST endpoint?

  5. markekraus commented on Jan 17, 2018

    @markekraus
    Contributor

    Kind of...

    • The API should be swagger defined
    • 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....

  6. iSazonov commented on Jan 17, 2018

    @iSazonov
    Collaborator

    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).

  7. SteveL-MSFT commented on Jan 18, 2018

    @SteveL-MSFT
    MemberAuthor

    Mark Kraus (@markekraus) perhaps you can author an RFC :)

  8. Jaykul commented on Oct 18, 2018

    @Jaykul
    Contributor

    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...

  9. SteveL-MSFT commented on Oct 18, 2018

    @SteveL-MSFT
    MemberAuthor

    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.

  10. it-praktyk commented on Oct 18, 2018

    @it-praktyk
    Contributor

    Matt Davis (@nitzmahone), Jordan Borean (@jborean93), is it something that can be used by Ansible to manage Windows?

  11. jborean93 commented on Oct 18, 2018

    @jborean93
    Collaborator

    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.

  12. Jaykul commented on Oct 18, 2018

    @Jaykul
    Contributor

    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 😬

  13. jborean93 commented on Oct 18, 2018

    @jborean93
    Collaborator

    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.

  14. kilasuit commented on Jul 20, 2022

    @kilasuit
    Collaborator

    this is also linked to #5681

  15. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    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.

  16. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    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.

  17. added
    Resolution-No Activity
    on Nov 16, 2023
  18. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    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.

  19. microsoft-github-policy-service commented on Nov 23, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-No ActivityWG-Interactive-ConsoleWG-Remoting

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions