Optimizing PowerShell Scripts to Reduce High Memory Usage - Fix Microsoft Store High CPU Usage-How to Check PowerShell Log File Location with Commands

Result check
- Keep one change per test run so you know which step helped.
- Undo temporary changes after the issue is confirmed.