darkoperator / darkoperator/Posh-SSH

Get-SCPItem "The given path's format is not supported", but everything is downloaded properly

Open
#601 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

Good day.
I have a problem with Get-SCPItem. Every time I try to download log files from ESXi server in the end of the downloading I receive an error message.

PS C:\Users\Administrator> Get-SCPItem -ComputerName $esxihost.Name -Credential $esxiCredential -Destination `
        ("$localLogPath"+$esxihost.Name) -Path "/scratch/log" -PathType Directory -Force -AcceptKey -Verbose -Debug
VERBOSE: Using SSH Username and Password authentication for connection.
WARNING: Host key is not being verified since Force switch is used.
VERBOSE: Connection successful
VERBOSE: Downloading /scratch/log
VERBOSE: Item type selected: Directory
VERBOSE: Destination: C:\logs\eam-ce-vbr-w22-31.10.2024.14.23\eam-ce-esxi2.ce.local\log
Get-SCPItem : The given path's format is not supported.
At line:1 char:1
+ Get-SCPItem -ComputerName $esxihost.Name -Credential $esxiCredential  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Renci.SshNet.ScpClient:ScpClient) [Get-SCPItem], NotSupportedException
    + FullyQualifiedErrorId : SSH.GetScpItem

The problem is that everything is downloads properly, but the message is still presented.
As a -Path I use a symlik.

This is my first attempt of writing an issue.
If you need an additional info - please inform.

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 by reproducing the Get-SCPItem command against an ESXi server with the symlinked /scratch/log path and observe when the error is emitted after downloads complete. Trace the Get-SCPItem entry point and its Renci.SshNet.ScpClient completion and error handling. Done means the directory downloads successfully without presenting a misleading path-format error, with regression coverage for this case.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.