darkoperator / darkoperator/Posh-SSH
Get-SFTPChildItem does not list file if exact filename specified
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 1.1k
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Description
In v3.2.4, Get-SFTPChildItem no longer has -Name parameter and seems like we are supposed to specify file name in -Parh parameter.
However, if you run, for example:
Get-SFTPChildItem -SessionId $sess.SessionId -Path '/home/vlad/.xteve/backup/xteve_auto_backup_20241012_0405.zip'
It will respond with:
Write-Error: Error listing items in /home/vlad/.xteve/backup/xteve_auto_backup_20241012_0405.zip: Exception calling "ListDirectory"
with "1" argument(s): "No such file"
Such file definitely exist and in v3.2.3, if you pass file name with -Name parameter, it returns info about that file.
Note: If you add asterisk in the end of the file name like that:
Get-SFTPChildItem -SessionId $sess.SessionId -Path '/home/vlad/.xteve/backup/xteve_auto_backup_20241012_0405.zip*'
everything will work, but it's inconvenient.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the exact-file-path case with Get-SFTPChildItem, then compare it with the wildcard form and the v3.2.3 -Name behavior described in the issue. Trace how Get-SFTPChildItem handles an exact remote path versus a pattern; done means an existing file is returned when its exact filename is supplied without requiring a trailing asterisk.
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