darkoperator / darkoperator/Posh-SSH

[Bug] - `Set-SftpItem` Stops `Enter-PSSession` Due to Progress Stream

Open
#588 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
1.1k
Forks
222
PR merge metrics
No merged PRs in 30d

Description

When I run the below type of flow, the powershell ( 5.1.17763.6189 on Microsoft Windows Server 2019 Datacenter ) session is killed with the below. My client is pwsh 7.4.5 though I connect to the Desktop endpoint. My module version is _ 3.1.2_ which is old and I'm just now seeing that.

Processing data from remote server server1 failed with the following error message:
    The WSMan provider host process did not return a proper response.  A provider in the host process may have
    behaved improperly. For more information, see the about_Remote_Troubleshooting Help topic.

I run get-sftpchilditem , I do see the file was partially uploaded.

etsn server1
new-sftpSession -ComputerName IPAddress -Port 22 -Credential user
set-sftpItem -SessionId 0 -Destination /home/user/ -Path .\file.zip
Workaround

Run the below prior to uploading files. So I assume there is something going on with out the progress stream is being written.

$progresspreference = 'SilentlyContinue'

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Set-SftpItem implementation and its progress-stream handling, then reproduce the etsN, New-SftpSession, and Set-SftpItem flow on the stated PowerShell versions. Compare behavior with $ProgressPreference set to SilentlyContinue; done means the upload completes without terminating Enter-PSSession and the session remains usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.