Re: Powershell Sftp Backup to remote NAS/Server
Hi Martin,
I didn't manage to implement your solution, but I did saw that in my script is a mistake, this line
It just gives me back a string of 1s, so for every file (ex.5 files) I get back a string like this
I didn't manage to implement your solution, but I did saw that in my script is a mistake, this line
#$x= $files.length
should be active. The greatest problem that I had is the counting of files by the remote server, when this line is executed:
$files = $session.EnumerateRemoteFiles($remotePath, $null, [WinSCP.EnumerationOptions]::None).count
It just gives me back a string of 1s, so for every file (ex.5 files) I get back a string like this
1 1 1 1 1
, that's why i needed to count with this line $x= $files.length
how many characters are in the string. It's a workaround, not the prettiest but works.