Posh-SSH icon indicating copy to clipboard operation
Posh-SSH copied to clipboard

Invalid path error when remote path contains an asterisk.

Open erikpt opened this issue 1 year ago • 2 comments

Working with Let's Encrypt wildcard certificates, the path contains an asterisk, which is valid on most Unix/Linux systems. Native SCP command handles this with using a backslash as the escape character.

Remote path: /home/user/.acme.sh/*.example.com/filename.cer

Command Line: $scpFile="/home/user/.acme.sh/*.example.com/filename.cer" Get-SCPItem -ComputerName $scpServer -Path $scpFile -Destination $(Get-Location).Path -Credential $scpCreds -PathType File -AcceptKey

SCP native equivalent scp [email protected]:/home/user/.acme.sh/*.example.com/filename.cer ./

Can this be permitted when PathType is File? Or better yet, replace the invalid character when downloading with an underscore?

erikpt avatar Feb 10 '25 22:02 erikpt