Script to download files non-recursively - failing permission denied
Hi, I'm trying to download files from an Sftp site with a basic power shell script based on the excellent one from here. I'm trying to download files ending with D.zip created in the last day from the root of the XML directory. The files are only from the root as the ID I'm using to access the directory doesn't have permissions to the sub directories. However when the script runs it doesn't download anything as it fails with the error below. The directory 1000 is one the ID has no permission too.
Error listing directory '/XML/1000'.
Permission denied.
Error code: 3
Error message from server (en): Permission denied.
The file mask I'm trying is FileMask = "*D.zip>=1D|*/"
Any help would be greatly appreciated. Script file attached.
Error listing directory '/XML/1000'.
Permission denied.
Error code: 3
Error message from server (en): Permission denied.
The file mask I'm trying is FileMask = "*D.zip>=1D|*/"
Any help would be greatly appreciated. Script file attached.