Powershell script to automate file transfers.
Posted: 2024-04-11 22:09
I'm working on a powershell script to automate file transfers with powershell and windows task scheduler.
Here is the script:
<removed link to bogus content>
#path to filezilla.exe (different from website)
$FileZillaPath="C:\FileZilla-3.66.5\filezilla.exe"
#path to filezilla site-manager.xml that has the SFTP, username, etc.... named SFTP_FileZilla.xml
$SiteManagerPath = "C:\scripts\FileZillaTesting\SFTP_FileZilla.xml"
# path to local and remote file paths
$LocalFilePath = "C:\scripts\*"
$RemoteFilePath = "/folder1/folder2/"
#build command to execute
$Command = "& '$FileZillaPath' --site=$SiteManagerPath --local=$LocalFilePath --remote=$RemotefilePath --upload"
#command execute
Invoke-Expression $Command
There is no "red text" in powershell and the script attempts to process, but I'm getting the error: "Unknown long option 'remote' "
I believe it's refencing the --remote=$RemotefilePath part and does not know what to do with it.
Has anyone seen this?
Here is the script:
<removed link to bogus content>
#path to filezilla.exe (different from website)
$FileZillaPath="C:\FileZilla-3.66.5\filezilla.exe"
#path to filezilla site-manager.xml that has the SFTP, username, etc.... named SFTP_FileZilla.xml
$SiteManagerPath = "C:\scripts\FileZillaTesting\SFTP_FileZilla.xml"
# path to local and remote file paths
$LocalFilePath = "C:\scripts\*"
$RemoteFilePath = "/folder1/folder2/"
#build command to execute
$Command = "& '$FileZillaPath' --site=$SiteManagerPath --local=$LocalFilePath --remote=$RemotefilePath --upload"
#command execute
Invoke-Expression $Command
There is no "red text" in powershell and the script attempts to process, but I'm getting the error: "Unknown long option 'remote' "
I believe it's refencing the --remote=$RemotefilePath part and does not know what to do with it.
Has anyone seen this?