jborean93 / pypsrp

PowerShell Remoting Protocol for Python
MIT License
324 stars 49 forks source link

No module named 'psrp' #158

Closed lrhazi closed 1 year ago

lrhazi commented 2 years ago

Trying to figure out how to use SSH transport.... After a pip install I cannot import psrp module!

# pip install pypsrp[ssh]
...
WARNING: pypsrp 0.8.1 does not provide the extra 'ssh'
...

Trying to run this example code:

import asyncssh
import psrp

async def ssh_example():
    conn_options = asyncssh.SSHClientConnectionOptions(
        username='username',
        password='password',
    )
    conn = psrp.SSHInfo('hostname', options=conn_options)
    async with psrp.AsyncRunspacePool(conn) as rp:
        ps = psrp.AsyncPowerShell(rp)
        ps.add_script('...')
        await ps.invoke()
jborean93 commented 1 year ago

The psrp examples are all for the pre-release version of 1.0.0 which is currently in beta. You can see the old code and documentation by going to https://github.com/jborean93/pypsrp/tree/v0.8.1, otherwise to install the pre-release do

pip install pypsrp[ssh] --pre
alfonsrv commented 1 year ago

The 1.0.0 version adds quite a lot of dependencies. Is that the reason it's still in beta or will it that stay unchanged?

jborean93 commented 1 year ago

Here are the list of dependencies

So in reality there's only really 2-3 deps that are new, psrpcore and httpx/httpcore. Apart from the last 2 this will stay unchanged and requests might be dropped at some point in the future (v2) but this is going to stay the same.

alfonsrv commented 1 year ago

Alright. Any chance to add a Become-like functionality?

jborean93 commented 1 year ago

For now it's not in the plans but that doesn't mean it won't be added in the future. I've got to focus on getting the beta into a more stable state first.

alfonsrv commented 1 year ago

Any way to help?

jborean93 commented 1 year ago

At this point you can try and test it out and let me know of any bugs you come across. I'm hoping to revisit this in the coming weeks and make it a bit more release ready.