Posted: 2016-02-03 13:21
Please excuse me if my question cover some topics, but I can't find exactly my theme.
So, I want upload files in remote folder which is created with timestamp for everyday.
1) I have path /home/user
2) script which find on winscp example - works, but I tried to change.
3) I success to create remote folder with session.CreateDirectory
But, I can't change location on ftp side, after create directory.
I'm using powershell version 1, on windows 2003 server.
Upload scripts as attached file.
Thank you for your time.
Description: script upload ftp
Location: Prague, Czechia
You need to use absolute paths.
$stamp = $(Get-Date -f "ddMMyyyy")
#Trying create newfolder
$session.CreateDirectory(("/" + $stamp))
# Upload files, collect results
$transferResult = $session.PutFiles($localPath, ("/" + $stamp + "/*"))
You can post new topics in this forum
And it's free!