I have added three enhancements to the script as mentioned here:

Tech Talk: Cleanup huge WindowsApps folder

1. Take ownership of the folder(s)
2. Set acl to allow the user to delete it from...