How to install RSAT for WIndows 10 using PSADT

I have been trying to get this to work using the Install-MSUpdates function and it simply doesn’t not install the .msu file. RSAT .msu file is also not named with “KB” in the name, so it seems to get looked over when scanning the $dirFiles directory.

Can anyone provide guidance on how to properly install RSAT for WIndows 10 using the toolkit, and how to properly uninstall it as well. I don’t see any “Uninstall-MSUpdates” function.

Additionally, I have read that the toolkit still detects an update as being installed even after the update has been manually uninstalled. ( https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/issues/277 ) Can this be corrected?

I’d just use WUSA to install it:

Execute-Process -Path ‘wusa.exe’ -Parameters “”$dirFiles\WindowsTH-RSAT_WS2016-x64.msu" /quiet /norestart" -WindowStyle Hidden -CreateNoWindow

To uninstall, just add the /uninstall switch:

Execute-Process -Path ‘wusa.exe’ -Parameters “/uninstall “$dirFiles\WindowsTH-RSAT_WS2016-x64.msu” /quiet /norestart” -WindowStyle Hidden -CreateNoWindow

If you’re using SCCM to deploy this, make sure you use the sysnative variable for 64-bit PCs…

Unfortunately, I still can’t get it to work. Execution failed with exit code [2] is the error I keep getting. Any other suggestions?

It looks like Exit Code 2 means it can’t find the MSU file. Did you escape the inner double quotes in the parameter section with backticks? The forum seems to remove them, although I’ve seen some people make it work, I haven’t figured it out yet… In the code below, just replace BT with the actual backtick `.

Execute-Process -Path ‘wusa.exe’ -Parameters “BT”$dirFiles\WindowsTH-RSAT_WS2016-x64Q.msuBT" /quiet /norestart" -WindowStyle Hidden -CreateNoWindow

Unfortunately, no luck using the syntax you’ve provided but after some trial and error I finally figured out the proper syntax to make it work, please see below. Thanks much for the advice!

Install:
Execute-Process -Path "wusa.exe" -WorkingDirectory "$dirFiles" -Parameters "WindowsTH-RSAT_WS2016-x64.msu /quiet /norestart" -WindowStyle 'Hidden' -CreateNoWindow

Uninstall:
Execute-Process -Path "wusa.exe" -WorkingDirectory "$dirFiles" -Parameters "/uninstall WindowsTH-RSAT_WS2016-x64.msu /quiet /norestart" -WindowStyle 'Hidden' -CreateNoWindow

1 Like