darkoperator / darkoperator/Posh-SSH

New-SFTPSession fails in NonInteractive mode

Open
#403 0 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

New-SFTPSession -ComputerName $HostName -Credential $cred -AcceptKey -Force

Execution of the above line gets failed , if a new server is passed (even if -AcceptKey and -Force are used). It works after first run.
Getting this error on first run:
Exception calling "ShouldContinue" with "2" argument(s): "Windows PowerShell is in NonInteractive mode. Read and Prompt functionality is not available."

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 New-SFTPSession entry point and reproduce the command against a new server in non-interactive mode. Compare the first run with the successful second run and trace the ShouldContinue prompt; done means the first run succeeds without prompting when -AcceptKey and -Force are supplied.

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.