Error: Exception calling "ParseUrl" with "1" argument(s): "R

Advertisement

Struikrover
Joined:
Posts:
1
Location:
Rotterdam

Error: Exception calling "ParseUrl" with "1" argument(s): "R

Met de extensie KeepLocalUpToDate.WinSCPextension.ps1 (mee geleverd met installatie. Bevindt zich in het Extensions path onder ..WinSCP..) in PowerShell heb ik in combinatie met WinSCP 5.13.2 continue de volgende melding:
Error: Exception calling "ParseUrl" with "1" argument(s): "Root folder can be specified for WebDAV protocol only
Dit naddat ik het -localpath heb ingevuld c:\temp\1 & het -remotepath /10.85.85.14/test als parameter

De credentials staan goed in PS1. Het loopt dus fout bij
# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.ParseUrl($sessionUrl)   <--
DE inhoud van de sessionoptions toont dit aan:
write  $sessionOptions
Protocol                                     : Sftp
HostName                                     : 
PortNumber                                   : 0
UserName                                     : 
Password                                     : 
SecurePassword                               : 
NewPassword                                  : 
SecureNewPassword                            : 
Timeout                                      : 00:00:15
TimeoutInMilliseconds                        : 15000
PrivateKeyPassphrase                         : 
SecurePrivateKeyPassphrase                   : 
SshHostKeyFingerprint                        : 
GiveUpSecurityAndAcceptAnySshHostKey         : False
SshPrivateKeyPath                            : 
SshPrivateKeyPassphrase                      : 
FtpMode                                      : Passive
FtpSecure                                    : None
WebdavSecure                                 : False
WebdavRoot                                   : 
TlsHostCertificateFingerprint                : 
GiveUpSecurityAndAcceptAnyTlsHostCertificate : False
TlsClientCertificatePath                     :
De bedoeling van het script is een lokale Directory gelijk houden met de FTP server.
Heeft iemand een idee / suggestie?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Error: Exception calling "ParseUrl" with "1" argument(s): "Root folder can be specified for WebDAV..

Can you post a complete PowerShell command-line that you use to execute the script?

Reply with quote

KRNY
Guest

I get same error

I get same error, however this is when I'm running this extension. Remember already downloaded files so they are not downloaded again
If I run it as an extension inside WinSCP it works, but when I try to run it through a bat file using this I receive error
Error: Exception calling "ParseUrl" with "1" argument(s): "Root folder can be specified for WebDAV protocol only
Parameter name: url"
powershell.exe -File C:\temp\DownloadNewFiles2.WinSCPextension.ps1 -sessionUrl "sftp://UUUUU:PPPPPP@test.sftp.test.com:4010;fingerprint=ssh-rsa 4096 SADASDfeage321431351/I" -localPath "c:\temp" -remotePath "/" -listPath "c:\temp\downloaded.txt" -sessionLogPath "c:\temp\sessionlog.log"

Reply with quote

martin
Site Admin
martin avatar

Re: I get same error

It's the I at the end of ...age321431351/I
It cannot be there. Is it mistake or intentional?

Reply with quote

Advertisement

FredEch
Joined:
Posts:
1
Location:
Pittsburgh, PA

I have this issue: Root path can be specified for WebDAV and S3 protocols only

Current PowerShell script I am running:
powershell.exe -File KeepLocalUpToDate.ps1 -sessionURL "sftp://username;fingerprint=ssh-rsa-pYxCX6hXnuthj7T9hL5ySuJyeYfUkjwlOPVK1RNY_0I@lfts.domain.com/redactesting/GPbackups/" -remotePath "/redactesting/GPBackups/" -localPath "C:\Users\Echegafa\Documents\GPBackups\"
Full Error:
Error: Exception calling "ParseUrl" with "1" argument(s): "Root path can be specified for WebDAV and S3 protocols only
Parameter name: url"
Thank you for your time and help.

Reply with quote

martin
Site Admin
martin avatar

Re: I have this issue: Root path can be specified for WebDAV and S3 protocols only

As the error message says, remove the path from the URL:
powershell.exe -File KeepLocalUpToDate.ps1 -sessionURL "sftp://username;fingerprint=ssh-rsa-pYxCX6hXnuthj7T9hL5ySuJyeYfUkjwlOPVK1RNY_0I@lfts.domain.com/redactesting/GPbackups/" -remotePath "/redactesting/GPBackups/" -localPath "C:\Users\Echegafa\Documents\GPBackups\"

Reply with quote

Advertisement

You can post new topics in this forum