Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO

PS does not work, could you help me to solve it?

0 votes
97 views
asked Sep 23, 2016 in CompleteFTP by inspell (120 points)

Hi,
On a download event when I'm using simple PS command like:

remove-Item d:\root\projects\* -recurse

it works like a charm, but when trying to execute:

Get-ChildItem -Path d:\root\projects -Recurse -Force | Where-Object { -not ($_.psiscontainer) } | Remove-Item –Force

nothing happens. The idea is to keep the folder structure under projects directory, but to delete all downloaded files. The idea is with added single process trigger to handle the entire sub folder structure but not to do a different event trigger for each project. Could you help me?

Thank you in advance!

commented Sep 23, 2016 by support2 (143,710 points)
We're not Powershell experts unfortunately. As a hack have you tried running it as a process invoking Powershell and passing the script as a file to execute?
commented Sep 26, 2016 by inspell (120 points)
Your suggestion works really nice, thank you! Still there is something like a bug or not sure how to describe it. Right now the script above deletes the files, no matter if the download was successful or if you refresh (using the f5) or log off your account, via the web browser (for example logging into the sftp by using browser). Any idea what could cause that, since only the "download file" event is checked?
commented Sep 26, 2016 by support2 (143,710 points)
If you enable debug logging in the server you should see why it is being triggered. If that doesn't help, you'll need to open a support ticket and send us the zipped debug log (http://enterprisedt.com/support/open.php).
commented Sep 27, 2016 by inspell (120 points)
Thank you very much!

Please log in or register to answer this question.

...