darkoperator / darkoperator/Posh-SSH
Set-SCPItem : Cannot process argument because the value of argument "path" is null
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 1.1k
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Description
Hello all,
With the command
Set-SCPItem -Path ".\file" -Destination "/home/pi/" -ComputerName $ComputerName -KeyFile $KeyFile -Credential $Credential -Port 2222
I always get Cannot process argument because the value of argument "path" is null. Change the value of argument "path" to a non-null value.
My private key has a password and I coded it like this :
$keyPassphrase = "aaaaaa"
$KeyFile = "C:\Users\USER\.ssh\id_rsa"
$secKeyPassphrase = ConvertTo-SecureString $keyPassphrase -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ($User, $secKeyPassphrase)
Same when Keyfile has no password.
Same when using "Set-SCPFile" which don't have this paramter "Path"...
I'm sure the error occurs at this command and not anywhere else.
PoshSSH version 2.2 (Install with Install-Module -Name Posh-SSH) ; Local OS: W10 ; remote OS: Raspbian 9.9 ; PS version: 5.1.18362.145 build 10.0.18362.145 ; SSH version on remote device: Open SSH_7.4p1
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 Set-SCPItem command with the supplied PowerShell 5.1 and Posh-SSH 2.2 details, then compare it with Set-SCPFile. Trace where the null path error is raised and verify how -Path, -Destination, -KeyFile, and -Credential are handled. Done means the command no longer rejects a valid local path, including when the key has or lacks a passphrase.
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