Hello,
Yes, a PowerShell script will perfectly fit for this purpose. Here's a sample script that deletes a folder specified by $folderPath.
# Get Remote Desktop Services profile path
$folderPath = "\\servername\datafiles\hou\%username%\MyDocuments\"
# Check whether the folder exists
if(!(Test-Path -Path $folderPath))
{
$Context.LogMessage("Folder '$folderPath' does not exist.", "Warning") # TODO: modify me
return
}
Remove-Item -Path $folderPath -Force -Recurse
To add the script to a Custom Command, Business Rule or Scheduled Task, use the Run a program or PowerShell script action.