I am using this command via ansible to delete old files
win_shell: forfiles -p C:\Logs\ -s -m *.log* /D -15 /C "cmd /c del /q @path"
How do I make sure to run this only if there is any file matching criteria
Found this similar question but it suppresses error instead of handling it proper way. i.e. only delete if exists.