"Can't get attributes of file" on RemoveFiles in PowerShelll

Advertisement

juppy
Joined:
Posts:
1

"Can't get attributes of file" on RemoveFiles in PowerShelll

I see a Can't get attributes of File" error invoking REmoveFiles from a Powershell script. PutFiles and ListDirectory in same script work fine. Wildcards "*" instead of specific filename also works fine. Help apreciated.

    WinScp : 5.1.7
    WingFTP Server (Lastest / Debian Linux)
    Win2k8R & Win7_32

$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::Ftp
$sessionOptions.HostName = "Server"
$sessionOptions.UserName = "user"
$sessionOptions.Password = "pass"
    
$session = New-Object WinSCP.Session
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
$session.Open($sessionOptions)

$Result = $Session.RemoveFiles("/path/file.pdf")
$Result.Check()

>> Exception calling "Check" with "0" argument(s): "Can't get attributes of file '/path/file.pdf'"

Reply with quote

Advertisement

Guest

Re: "Can't get attributes of file" on RemoveFiles in PowerShelll

The log of the server hints a problem:
MLST /path/file.pdf
502 Command not implemented
.

So how to disable that?
[/code]

Reply with quote

Advertisement

You can post new topics in this forum