Mostly getting rid of redundant code that was doing the same thing over top of itself (ex: NewItemProperty with a value and then next line set the exact same value??)
Also added some more that was missed with telemetry, bing in the start menu, disabling cortana completely, and fully removing OneDrive and removed it from the side bar in explorer.
Added an admin check to see if the script is running with admin right, if it isn't then it'll close and reopen with admin right and continue on.
Also added a GUI to replace the need for "read-host" to get a response from USER
I removed the switch containing interactive/noninteractive choices since the noninteractive option only cut down the amount of interactive prompts by 2, and I saw no value with keeping it. I also fixed the formatting of the code and it should be a bit more presentable now.
I added a new Function called FixWhitelistedApps, which will check to see if any of the Whitelisted Apps were removed, and if so it should re-add them.
I then changed the code in the function Start-Debloat, given to me by Reddit user /u/GavinEke.
I changed the Start-Debloat Function's code to use [regex] as explained in the following link: https://www.reddit.com/r/PowerShell/comments/7xzwah/4_whitelisted_apps_in_my_script_are_being_removed/\
Thanks to Reddit user /u/GavinEke for the help.
I added a new Function called FixWhitelistedApps which will run and check to see if the Whitelisted apps in the Start-Debloat function were removed, and if so it should bring them back.
I fixed the issue where the whitelisted apps were being removed.
I then changed the conditional operator on lines 22-25, and lines 36-39, from -notlike to -notcontains. I also removed the asterisks from the AppXPackage/AppXProvisionedPackage names which results in the whitelisting working appropriately. The whitelisted apps are no longer being removed.
I fixed an issue where the whitelisted apps; Paint3D, Calculator, Store, and Photos were being removed.
I changed the conditional operator from -notlike to -notcontains on lines 22-25, and lines 30-33. Then, I removed the asterisks from each AppXPackage/AppXProvisionedPackage name.
The issue of the whitelisted apps being removed should no longer be the case.