I would like to use a powershell script to delete all PDF files from user folders that are older than 30 days. I'm using the get-childitem command and need to look in a specific folder for each user. Is there a way to use a variable in the target folder path like E:\users\%username%\documents\scans"?
The script below works like I want but only for the one specified user folder. I need it to run for all user folders.