Install Windows 10 Theme

I have a deployment for our corporate theme for Windows 10 that I created in WinBatch. I’m trying to port it over to PSADT, but I’m having a problem with one of the steps.

In my original script, I execute CorpTheme.themepack, but when I try to use Execute-Process to run CorpTheme.themepack, it report “The specified executable is not a valid application for this OS Platform.” It appears to have worked, but I don’t like the fact that it’s reporting an error. I’d rather not script around the error, because then I’ll never know when I really DO have an error.

I re-exported the theme, and Windows 10 gave it the extension .deskthemepack. I tried executing it with Execute-Process, and got the same error message.

I have come up with A solution, but I’m always interested in finding other ways.

I replaced Execute-Process with this:
Start-Process $ThemeFile
Start-Sleep -s 10
Get-Process -Name SystemSettings | Stop-Process -Force

I’m not thrilled with having the Settings window randomly appearing on the screen, but in theory, no one will ever be looking at the screen when this takes place.