You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'll have to think about this, and try some refactoring. the -Destination should be a directory, not a full file path. But, I think it should support this. So I'll have to refactor that function a bit. Thanks for letting me know.
I've had a similar issue. I've used the Get-WinSCPChildItem
with the -Filter parameter. This returned me an array of objects.
The files and folders which should get ignored by the filter are represented with $null
in the returned array. Therefore, the following cmdlets failed ( in my case Receive-WinSCPChildItem).
I've fixed it by removing the $null values from the array. Here is an example:
# ...# define filters$types=@("*.csv","*.xls*","*.txt")
# get files on the remote$files=foreach($typein$types){
Get-WinSCPChildItem-Path $Source-Filter $type-WinSCPSession $Session
}
# ...# Remove $null values from $files $files|Select-Object {$_-ne$null}
# Download files Receive-WinSCPChildItem-RemotePath $files-LocalPath $Destination-WinSCPSession $Session
Please fill in the following fields:
Issue Description
Copy-WinSCPItem fails when attempting to copy a file
Example
Copy-WinSCPItem -Path /tmp/test1.txt -Destination /tmp/test2.txt
Expected Output
A copy of /tmp/test1.txt is made and written to /tmp/test2.txt
Actual Output
Cannot bind argument to parameter 'Path' because it is null.
WinSCP-PowerShell Version
6.1.2.0
Environment
Windows 10
PowerShell 5.1
WinSCP session is SCP
Session option also includes SSHhoskeypolicy = 'AcceptNew'
The text was updated successfully, but these errors were encountered: