tomohulk / WinSCP

WinSCP PowerShell Wrapper Module
GNU General Public License v3.0
153 stars 30 forks source link

Receive-WinSCPItem LocalPath fails if relative #146

Closed Szeraax closed 1 year ago

Szeraax commented 1 year ago

Issue Description

I cannot use a relative path in the LocalPath parameter when downloading a file. May affect sending as well, dunno.

Example

Receive-WinSCPItem -WinSCPSession $session -RemotePath $items[0].FullName -LocalPath .\

Expected Output

File info

Actual Output

Receive-WinSCPItem: WinSCP.SessionRemoteException: Can't create file '.\file.txt.filepart'.
System Error.  Code: 3.
The system cannot find the path specified

Example

Receive-WinSCPItem -WinSCPSession $session -RemotePath $items[0].FullName -LocalPath .\foldername\ Receive-WinSCPItem -WinSCPSession $session -RemotePath $items[0].FullName -LocalPath ~ Receive-WinSCPItem -WinSCPSession $session -RemotePath $items[0].FullName -LocalPath .

WinSCP-PowerShell Version

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     5.21.7.0              WinSCP                              {ConvertTo-WinSCPEscapedString, Copy-WinSCPItem, G…

Environment

Pwsh 7.3.3 on Server 2016

tomohulk commented 1 year ago

I fixed this, but im trying to work out a new build process, so if you want you can clone this repo, or just replace your "Receive-WinSCPItem.ps1" in the public folder with the updated one here. I'll try and get the build process fixed this week so I can get a new version published.