I am trying to get the below PowerShell script to work using Task Scheduler. The problem is that it wont delete any files.
When I run it manually it needs a confirma
Remove-Item foldertodelete -Recurse -Force -Confirm:$false
works for me.