Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Copy-WinSCPItem : Cannot bind argument to parameter 'Path' because it is null.

WinSCP PowerShell module is 3rd party library. We do not support it here.
But in general, Copy-WinSCPItem should copy remote file to another remote file. But you are passing two local/Windows paths to it. That does not seem correct.
sellerdavid18@...

Copy-WinSCPItem : Cannot bind argument to parameter 'Path' because it is null.

Hi all, im tired of this error, mi code its really simple and i dont know whats wrong whit it.
Import-Module WinSCP
$credenciales = get-credential
$opciones = New-WinSCPSessionOption -HostName "ip_address" -Credential $credenciales -PortNumber "22" -SshHostKeyFingerprint "m6MF3ChDcoZjIxkzDKspcGprjm5qb5lwVhpYUZZlU/I"
$sesion = New-WinSCPSession -SessionOption $opciones
Write-Host "copy0"
$ruta = "\temp\file.csv"
Copy-WinSCPItem -Path $ruta -Destination "C:\Users\david_salamanca\Documents\folder"
Write-Host "copy1"

This its the error:
Copy-WinSCPItem : Cannot bind argument to parameter 'Path' because it is null.

At C:\Users\david_salamanca\Documents\Untitled1.ps1:8 char:1
+ Copy-WinSCPItem -Path $ruta -Destination "C:\Users\david_salamanc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Copy-WinSCPItem], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Copy-WinSCPItem