I added code to check for the OneDrive folder and its files before removal. If it finds that the folder exists, it will then check to see if there are files inside of the folder. If there are no files then OneDrive is uninstalled.
If there are files, then it creates a new folder called OneDriveBackupFiles on the user's desktop, move all of the files into that folder, and then removes OneDrive.
This is a safety measure after a user had their OneDrive files (unfortunately) deleted from their machine.
I added code to check for the OneDrive folder and its files before removal. If it finds that the folder exists, it will then check to see if there are files inside of the folder. If there are no files then OneDrive is uninstalled.
If there are files, then it creates a new folder called OneDriveBackupFiles on the user's desktop, move all of the files into that folder, and then removes OneDrive.
This is a safety measure after a user had their OneDrive files (unfortunately) deleted from their machine.
& sc config InstallService start=disabled -> Gave me an error, used power shell command and it worked without errors
re-run line 41 in order to avoid error or having to reboot.
I removed the code from line 15 as this will wipe more than the target appxpackages/appxprovisionedpackages since even some games/apps/etc from the Microsoft Store and others that are wanted will be removed.
I added a new blacklist function called DebloatBlacklist which will only remove the specified bloatware in the array in the function.
I also renamed the Start-Debloat function to DebloatAllApps since it seemed to remove absolutely everything related to the Microsoft Store (Any games, apps, etc).
When you hit "Yes" in the first prompt, you will be asked if you want debloat via a blacklist or if you want to remove everything, in terms of apps.
I removed the line of code get-appxpackage | remove-appxpackage from the Begin-SysPrep function because it was accidentally removing all packages.
I also removed the If statement in the FixWhitelistedApps since it wasn't necessary.