I'm working on a PowerShell script that copies a theme file from a network location to a local folder on Windows 11, and then tries to apply that theme. The script runs perfectly on my computer, but on both my VM and physical machines, it says the operation completes successfully, yet it only partially works. The file successfully moves to the destination, but the theme doesn't apply. Here's a brief overview of the script: It checks if a temporary folder exists and creates it if needed, copies the theme file from the network, and then attempts to apply the theme. Any tips on why it's failing to apply the theme on other machines would be greatly appreciated!
3 Answers
Have you tried removing the `-ErrorAction SilentlyContinue` part? Sometimes it can mask underlying issues that are causing commands to fail. If errors show up, they'll help you identify what's going wrong. Give that a shot!
If your script is copying the file but not applying the theme, you might want to run the script in a terminal and watch for any error messages while it runs. Those messages can really point you toward what’s going wrong, especially if there’s a problem executing the file afterwards.
It looks like your script's failing at some point after the copy process. Make sure C:Temp really exists on those other machines. You might want to review the permissions as well; sometimes, the scripts need admin rights to apply changes like themes. Also, double-check that your local file path isn't just wrong or containing typos in the script itself. Just a thought!
Thanks for the tip! I'll check the permissions and make sure everything's correct.