Post a reply

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: 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\"
FredEch

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.
Guest

Re: I get same error

I get the same error. It appears to be a bug when there is a slash in the fingerprint.
martin

Re: I get same error

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

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"
martin

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?
Struikrover

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?