Sycnex / Windows10Debloater

Script to remove Windows 10 bloatware.
MIT License
18.13k stars 2.04k forks source link

Make the silent script more sysprep friendly? #2

Closed a60wattfish closed 6 years ago

a60wattfish commented 6 years ago

Would it be possible to add a switch/option somewhere to the silent script to make it sysprep friendly? Basically, sysprep will fail if any apps from the appstore are installed on the current user profile. To get around this you need to get-appxpackage | remove-appxpackage . After doing this sysprep runs and when a user is logged onto a computer is built using the prepared image, the appropriate provisioned packages will be installed (App Store).

a60wattfish commented 6 years ago

Just doing some testing with this currently, not sure if this is the best solution to fixing sysprep.

a60wattfish commented 6 years ago

Finished testing this. Apps weren't being provisioned, but it was due to issue https://github.com/Sycnex/Windows10Debloater/issues/3 . Once that issue is fixed, running get-appxpackage | remove-appxpackage is required for sysprep to be able to work. The store and others that are whitelisted install automatically after doing this when you image a machine and login.

Sycnex commented 6 years ago

I added a $SysPrep switch parameter and function on lines 7 - 17. This will run the following command: get-appxpackage | remove-appxpackage. This is required in order to be used successfully with SysPrep.

I also added a $StopEdgePDF parameter, for those who do not wish to stop Edge from being used as the default PDF viewer, or for those who worry about unintended consequences (not being able to potentially choose Edge without removing the specified registry keys).

You can now run the script with the switch parameter -SysPrep, along with -Debloat, and -StopEdgePDF.

I also changed the name of the file (it just sounds better) to Windows10SilentDebloater.ps1.