I'm writing a Powershell script to deploy files to an FTP server. I need to remove any existing files and subdirectories in the directory before i upload the new files.
The FTP protocol, however, does not allow the deletion of non-empty directories, so in order to accomplish this i would need to recursively query for files and directories and then delete them, starting with files in the deepest directory first.
Is there any built-in functionality or libraries i can use to delete a non-empty directory on a FTP server? I don't want to reinvent the wheel.