[
  {
    "path": "Individual Scripts/Clear Last Used Files and Folders.ps1",
    "content": "Write-Host \"Clear last used files and folders\"\n\tRemove-Item %APPDATA%\\Microsoft\\Windows\\Recent\\AutomaticDestinations\\*.automaticDestinations-ms -FORCE -ErrorAction SilentlyContinue"
  },
  {
    "path": "Individual Scripts/Debloat Windows",
    "content": "$AppXApps = @(\n\n        #Unnecessary Windows 10 AppX Apps\n        \"*Microsoft.BingNews*\"\n        \"*Microsoft.GetHelp*\"\n        \"*Microsoft.Getstarted*\"\n        \"*Microsoft.Messaging*\"\n        \"*Microsoft.Microsoft3DViewer*\"\n        \"*Microsoft.MicrosoftOfficeHub*\"\n        \"*Microsoft.MicrosoftSolitaireCollection*\"\n        \"*Microsoft.NetworkSpeedTest*\"\n        \"*Microsoft.Office.Sway*\"\n        \"*Microsoft.OneConnect*\"\n        \"*Microsoft.People*\"\n        \"*Microsoft.Print3D*\"\n        \"*Microsoft.SkypeApp*\"\n        \"*Microsoft.WindowsAlarms*\"\n        \"*Microsoft.WindowsCamera*\"\n        \"*microsoft.windowscommunicationsapps*\"\n        \"*Microsoft.WindowsFeedbackHub*\"\n        \"*Microsoft.WindowsMaps*\"\n        \"*Microsoft.WindowsSoundRecorder*\"\n        \"*Microsoft.Xbox.TCUI*\"\n        \"*Microsoft.XboxApp*\"\n        \"*Microsoft.XboxGameOverlay*\"\n        \"*Microsoft.XboxIdentityProvider*\"\n        \"*Microsoft.XboxSpeechToTextOverlay*\"\n        \"*Microsoft.ZuneMusic*\"\n        \"*Microsoft.ZuneVideo*\"\n\n        #Sponsored Windows 10 AppX Apps\n        #Add sponsored/featured apps to remove in the \"*AppName*\" format\n        \"*EclipseManager*\"\n        \"*ActiproSoftwareLLC*\"\n        \"*AdobeSystemsIncorporated.AdobePhotoshopExpress*\"\n        \"*Duolingo-LearnLanguagesforFree*\"\n        \"*PandoraMediaInc*\"\n        \"*CandyCrush*\"\n        \"*Wunderlist*\"\n        \"*Flipboard*\"\n        \"*Twitter*\"\n        \"*Facebook*\"\n        \"*Spotify*\"\n\n        #Optional: Typically not removed but you can if you need to for some reason\n        #\"*Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe*\"\n        #\"*Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe*\"\n        #\"*Microsoft.BingWeather*\"\n        #\"*Microsoft.MSPaint*\"\n        #\"*Microsoft.MicrosoftStickyNotes*\"\n        #\"*Microsoft.Windows.Photos*\"\n        #\"*Microsoft.WindowsCalculator*\"\n        #\"*Microsoft.WindowsStore*\"\n    )\n    foreach ($App in $AppXApps) {\n        Write-Verbose -Message ('Removing Package {0}' -f $App)\n        Get-AppxPackage -Name $App | Remove-AppxPackage -ErrorAction SilentlyContinue\n        Get-AppxPackage -Name $App -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue\n        Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $App | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue\n    }\n    \n    #Removes AppxPackages\n    #Credit to /u/GavinEke for a modified version of my whitelist code\n    [regex]$WhitelistedApps = 'Microsoft.Paint3D|Microsoft.WindowsCalculator|Microsoft.WindowsStore|Microsoft.Windows.Photos|CanonicalGroupLimited.UbuntuonWindows|Microsoft.XboxGameCallableUI|Microsoft.XboxGamingOverlay|Microsoft.Xbox.TCUI|Microsoft.XboxGamingOverlay|Microsoft.XboxIdentityProvider|Microsoft.MicrosoftStickyNotes|Microsoft.MSPaint*'\n    Get-AppxPackage -AllUsers | Where-Object {$_.Name -NotMatch $WhitelistedApps} | Remove-AppxPackage\n    Get-AppxPackage | Where-Object {$_.Name -NotMatch $WhitelistedApps} | Remove-AppxPackage\n    Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName -NotMatch $WhitelistedApps} | Remove-AppxProvisionedPackage -Online\n"
  },
  {
    "path": "Individual Scripts/Disable Cortana",
    "content": "Write-Host \"Disabling Cortana\"\n    $Cortana1 = \"HKCU:\\SOFTWARE\\Microsoft\\Personalization\\Settings\"\n    $Cortana2 = \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\"\n    $Cortana3 = \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\\TrainedDataStore\"\n\tIf (!(Test-Path $Cortana1)) {\n\t\tNew-Item $Cortana1\n\t}\n\tSet-ItemProperty $Cortana1 AcceptedPrivacyPolicy -Value 0 \n\tIf (!(Test-Path $Cortana2)) {\n\t\tNew-Item $Cortana2\n\t}\n\tSet-ItemProperty $Cortana2 RestrictImplicitTextCollection -Value 1 \n\tSet-ItemProperty $Cortana2 RestrictImplicitInkCollection -Value 1 \n\tIf (!(Test-Path $Cortana3)) {\n\t\tNew-Item $Cortana3\n\t}\n\tSet-ItemProperty $Cortana3 HarvestContacts -Value 0\n"
  },
  {
    "path": "Individual Scripts/Disable Last Used Files and Folders View.ps1",
    "content": "$Keys = @(\n            \n        # Deactivate showing of last used files\n\t\t\"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HomeFolderDesktop\\NameSpace\\DelegateFolders\\{3134ef9c-6b18-4996-ad04-ed5912e00eb5}\"\n\t\t\n\t\t# Deactivate showing of last used folders\n\t\t\"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HomeFolderDesktop\\NameSpace\\DelegateFolders\\{3936E9E4-D92C-4EEE-A85A-BC16D5EA0819}\"\n    )\n        \n    #This writes the output of each key it is removing and also removes the keys listed above.\n    ForEach ($Key in $Keys) {\n        Write-Output \"Removing $Key from registry\"\n        Remove-Item $Key -Recurse\n    }"
  },
  {
    "path": "Individual Scripts/Enable Cortana",
    "content": "Write-Host \"Re-enabling Cortana\"\n    $Cortana1 = \"HKCU:\\SOFTWARE\\Microsoft\\Personalization\\Settings\"\n    $Cortana2 = \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\"\n    $Cortana3 = \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\\TrainedDataStore\"\n\tIf (!(Test-Path $Cortana1)) {\n\t\tNew-Item $Cortana1\n\t}\n\tSet-ItemProperty $Cortana1 AcceptedPrivacyPolicy -Value 1 \n\tIf (!(Test-Path $Cortana2)) {\n\t\tNew-Item $Cortana2\n\t}\n\tSet-ItemProperty $Cortana2 RestrictImplicitTextCollection -Value 0 \n\tSet-ItemProperty $Cortana2 RestrictImplicitInkCollection -Value 0 \n\tIf (!(Test-Path $Cortana3)) {\n\t\tNew-Item $Cortana3\n\t}\n\tSet-ItemProperty $Cortana3 HarvestContacts -Value 1 \n"
  },
  {
    "path": "Individual Scripts/Enable Edge PDF",
    "content": "Write-Output \"Setting Edge back to default\"\n    $NoPDF = \"HKCR:\\.pdf\"\n    $NoProgids = \"HKCR:\\.pdf\\OpenWithProgids\"\n    $NoWithList = \"HKCR:\\.pdf\\OpenWithList\"\n    #Sets edge back to default\n    If (Get-ItemProperty $NoPDF  NoOpenWith) {\n        Remove-ItemProperty $NoPDF  NoOpenWith\n    } \n    If (Get-ItemProperty $NoPDF  NoStaticDefaultVerb) {\n        Remove-ItemProperty $NoPDF  NoStaticDefaultVerb \n    }       \n    If (Get-ItemProperty $NoProgids  NoOpenWith) {\n        Remove-ItemProperty $NoProgids  NoOpenWith \n    }        \n    If (Get-ItemProperty $NoProgids  NoStaticDefaultVerb) {\n        Remove-ItemProperty $NoProgids  NoStaticDefaultVerb \n    }        \n    If (Get-ItemProperty $NoWithList  NoOpenWith) {\n        Remove-ItemProperty $NoWithList  NoOpenWith\n    }    \n    If (Get-ItemProperty $NoWithList  NoStaticDefaultVerb) {\n        Remove-ItemProperty $NoWithList  NoStaticDefaultVerb\n    }\n        \n    #Removes an underscore '_' from the Registry key for Edge\n    $Edge2 = \"HKCR:\\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_\"\n    If (Test-Path $Edge2) {\n        Set-Item $Edge2 AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723\n    }\n"
  },
  {
    "path": "Individual Scripts/Fix Whitelisted Apps",
    "content": "If (!(Get-AppxPackage -AllUsers | Select Microsoft.Paint3D, Microsoft.WindowsCalculator, Microsoft.WindowsStore, Microsoft.Windows.Photos)) {\n    \n        #Credit to abulgatz for these 4 lines of code\n        Get-AppxPackage -allusers Microsoft.Paint3D | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n        Get-AppxPackage -allusers Microsoft.WindowsCalculator | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n        Get-AppxPackage -allusers Microsoft.WindowsStore | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n        Get-AppxPackage -allusers Microsoft.Windows.Photos | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"} \n    } \n"
  },
  {
    "path": "Individual Scripts/Protect Privacy",
    "content": "#Disables Windows Feedback Experience\n    Write-Output \"Disabling Windows Feedback Experience program\"\n    $Advertising = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AdvertisingInfo\"\n    If (Test-Path $Advertising) {\n        Set-ItemProperty $Advertising Enabled -Value 0 \n    }\n            \n    #Stops Cortana from being used as part of your Windows Search Function\n    Write-Output \"Stopping Cortana from being used as part of your Windows Search Function\"\n    $Search = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\"\n    If (Test-Path $Search) {\n        Set-ItemProperty $Search AllowCortana -Value 0 \n    }\n\n    #Disables Web Search in Start Menu\n    Write-Output \"Disabling Bing Search in Start Menu\"\n    $WebSearch = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\"\n    Set-ItemProperty \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Search\" BingSearchEnabled -Value 0 \n\tIf (!(Test-Path $WebSearch)) {\n        New-Item $WebSearch\n\t}\n\tSet-ItemProperty $WebSearch DisableWebSearch -Value 1 \n            \n    #Stops the Windows Feedback Experience from sending anonymous data\n    Write-Output \"Stopping the Windows Feedback Experience program\"\n    $Period = \"HKCU:\\Software\\Microsoft\\Siuf\\Rules\"\n    If (!(Test-Path $Period)) { \n        New-Item $Period\n    }\n    Set-ItemProperty $Period PeriodInNanoSeconds -Value 0 \n\n    #Prevents bloatware applications from returning and removes Start Menu suggestions               \n    Write-Output \"Adding Registry key to prevent bloatware apps from returning\"\n    $registryPath = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\"\n    $registryOEM = \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\"\n    If (!(Test-Path $registryPath)) { \n        New-Item $registryPath\n    }\n    Set-ItemProperty $registryPath DisableWindowsConsumerFeatures -Value 1 \n\n    If (!(Test-Path $registryOEM)) {\n        New-Item $registryOEM\n    }\n        Set-ItemProperty $registryOEM  ContentDeliveryAllowed -Value 0 \n        Set-ItemProperty $registryOEM  OemPreInstalledAppsEnabled -Value 0 \n        Set-ItemProperty $registryOEM  PreInstalledAppsEnabled -Value 0 \n        Set-ItemProperty $registryOEM  PreInstalledAppsEverEnabled -Value 0 \n        Set-ItemProperty $registryOEM  SilentInstalledAppsEnabled -Value 0 \n        Set-ItemProperty $registryOEM  SystemPaneSuggestionsEnabled -Value 0          \n    \n    #Preping mixed Reality Portal for removal    \n    Write-Output \"Setting Mixed Reality Portal value to 0 so that you can uninstall it in Settings\"\n    $Holo = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Holographic\"    \n    If (Test-Path $Holo) {\n        Set-ItemProperty $Holo  FirstRunSucceeded -Value 0 \n    }\n\n    #Disables Wi-fi Sense\n    Write-Output \"Disabling Wi-Fi Sense\"\n    $WifiSense1 = \"HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\default\\WiFi\\AllowWiFiHotSpotReporting\"\n    $WifiSense2 = \"HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\default\\WiFi\\AllowAutoConnectToWiFiSenseHotspots\"\n    $WifiSense3 = \"HKLM:\\SOFTWARE\\Microsoft\\WcmSvc\\wifinetworkmanager\\config\"\n    If (!(Test-Path $WifiSense1)) {\n\t    New-Item $WifiSense1\n    }\n    Set-ItemProperty $WifiSense1  Value -Value 0 \n\tIf (!(Test-Path $WifiSense2)) {\n\t    New-Item $WifiSense2\n    }\n    Set-ItemProperty $WifiSense2  Value -Value 0 \n\tSet-ItemProperty $WifiSense3  AutoConnectAllowedOEM -Value 0 \n        \n    #Disables live tiles\n    Write-Output \"Disabling live tiles\"\n    $Live = \"HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CurrentVersion\\PushNotifications\"    \n    If (!(Test-Path $Live)) {      \n        New-Item $Live\n    }\n    Set-ItemProperty $Live  NoTileApplicationNotification -Value 1 \n        \n    #Turns off Data Collection via the AllowTelemtry key by changing it to 0\n    Write-Output \"Turning off Data Collection\"\n    $DataCollection1 = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection\"\n    $DataCollection2 = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection\"\n    $DataCollection3 = \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection\"    \n    If (Test-Path $DataCollection1) {\n        Set-ItemProperty $DataCollection1  AllowTelemetry -Value 0 \n    }\n    If (Test-Path $DataCollection2) {\n        Set-ItemProperty $DataCollection2  AllowTelemetry -Value 0 \n    }\n    If (Test-Path $DataCollection3) {\n        Set-ItemProperty $DataCollection3  AllowTelemetry -Value 0 \n    }\n    \n    #Disabling Location Tracking\n    Write-Output \"Disabling Location Tracking\"\n    $SensorState = \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Sensor\\Overrides\\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}\"\n    $LocationConfig = \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\lfsvc\\Service\\Configuration\"\n    If (!(Test-Path $SensorState)) {\n        New-Item $SensorState\n    }\n    Set-ItemProperty $SensorState SensorPermissionState -Value 0 \n    If (!(Test-Path $LocationConfig)) {\n        New-Item $LocationConfig\n    }\n    Set-ItemProperty $LocationConfig Status -Value 0 \n        \n    #Disables People icon on Taskbar\n    Write-Output \"Disabling People icon on Taskbar\"\n    $People = \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\People\"    \n    If (!(Test-Path $People)) {\n        New-Item $People\n    }\n    Set-ItemProperty $People  PeopleBand -Value 0 \n        \n    #Disables scheduled tasks that are considered unnecessary \n    Write-Output \"Disabling scheduled tasks\"\n    Get-ScheduledTask  XblGameSaveTaskLogon | Disable-ScheduledTask\n    Get-ScheduledTask  XblGameSaveTask | Disable-ScheduledTask\n    Get-ScheduledTask  Consolidator | Disable-ScheduledTask\n    Get-ScheduledTask  UsbCeip | Disable-ScheduledTask\n    Get-ScheduledTask  DmClient | Disable-ScheduledTask\n    Get-ScheduledTask  DmClientOnScenarioDownload | Disable-ScheduledTask\n    \n    Write-Output \"Stopping and disabling WAP Push Service\"\n    #Stop and disable WAP Push Service\n\tStop-Service \"dmwappushservice\"\n\tSet-Service \"dmwappushservice\" -StartupType Disabled\n\n    Write-Output \"Stopping and disabling Diagnostics Tracking Service\"\n    #Disabling the Diagnostics Tracking Service\n\tStop-Service \"DiagTrack\"\n\tSet-Service \"DiagTrack\" -StartupType Disabled\n"
  },
  {
    "path": "Individual Scripts/Remove Bloatware RegKeys",
    "content": "$Keys = @(\n            \n        #Remove Background Tasks\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy\"\n            \n        #Windows File\n        \"HKCR:\\Extensions\\ContractId\\Windows.File\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n            \n        #Registry keys to delete if they aren't uninstalled by RemoveAppXPackage/RemoveAppXProvisionedPackage\n        \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy\"\n            \n        #Scheduled Tasks to delete\n        \"HKCR:\\Extensions\\ContractId\\Windows.PreInstalledConfigTask\\PackageId\\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe\"\n            \n        #Windows Protocol Keys\n        \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy\"\n               \n        #Windows Share Target\n        \"HKCR:\\Extensions\\ContractId\\Windows.ShareTarget\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n    )\n        \n    #This writes the output of each key it is removing and also removes the keys listed above.\n    ForEach ($Key in $Keys) {\n        Write-Output \"Removing $Key from registry\"\n        Remove-Item $Key -Recurse\n    }\n"
  },
  {
    "path": "Individual Scripts/Revert Changes",
    "content": "#This function will revert the changes you made when running the Start-Debloat function.\n        \n    #This line reinstalls all of the bloatware that was removed\n    Get-AppxPackage -AllUsers | ForEach {Add-AppxPackage -Verbose -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"} \n    \n    #Tells Windows to enable your advertising information.    \n    Write-Output \"Re-enabling key to show advertisement information\"\n    $Advertising = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AdvertisingInfo\"\n    If (Test-Path $Advertising) {\n        Set-ItemProperty $Advertising  Enabled -Value 1\n    }\n            \n    #Enables Cortana to be used as part of your Windows Search Function\n    Write-Output \"Re-enabling Cortana to be used in your Windows Search\"\n    $Search = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\"\n    If (Test-Path $Search) {\n        Set-ItemProperty $Search  AllowCortana -Value 1 \n    }\n            \n    #Re-enables the Windows Feedback Experience for sending anonymous data\n    Write-Output \"Re-enabling Windows Feedback Experience\"\n    $Period = \"HKCU:\\Software\\Microsoft\\Siuf\\Rules\"\n    If (!(Test-Path $Period)) { \n        New-Item $Period\n    }\n    Set-ItemProperty $Period PeriodInNanoSeconds -Value 1 \n    \n    #Enables bloatware applications               \n    Write-Output \"Adding Registry key to allow bloatware apps to return\"\n    $registryPath = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\"\n    If (!(Test-Path $registryPath)) {\n        New-Item $registryPath \n    }\n    Set-ItemProperty $registryPath  DisableWindowsConsumerFeatures -Value 0 \n        \n    #Changes Mixed Reality Portal Key 'FirstRunSucceeded' to 1\n    Write-Output \"Setting Mixed Reality Portal value to 1\"\n    $Holo = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Holographic\"\n    If (Test-Path $Holo) {\n        Set-ItemProperty $Holo  FirstRunSucceeded -Value 1 \n    }\n        \n    #Re-enables live tiles\n    Write-Output \"Enabling live tiles\"\n    $Live = \"HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CurrentVersion\\PushNotifications\"\n    If (!(Test-Path $Live)) {\n        New-Item $Live \n    }\n    Set-ItemProperty $Live  NoTileApplicationNotification -Value 0 \n       \n    #Re-enables data collection\n    Write-Output \"Re-enabling data collection\"\n    $DataCollection = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection\"\n    If (!(Test-Path $DataCollection)) {\n        New-Item $DataCollection\n    }\n    Set-ItemProperty $DataCollection  AllowTelemetry -Value 1\n        \n    #Re-enables People Icon on Taskbar\n    Write-Output \"Enabling People icon on Taskbar\"\n    $People = \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\People\"\n    If (!(Test-Path $People)) {\n        New-Item $People \n    }\n    Set-ItemProperty $People  PeopleBand -Value 1 \n    \n    #Re-enables suggestions on start menu\n    Write-Output \"Enabling suggestions on the Start Menu\"\n    $Suggestions = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\"\n    If (!(Test-Path $Suggestions)) {\n        New-Item $Suggestions\n    }\n    Set-ItemProperty $Suggestions  SystemPaneSuggestionsEnabled -Value 1 \n        \n    #Re-enables scheduled tasks that were disabled when running the Debloat switch\n    Write-Output \"Enabling scheduled tasks that were disabled\"\n    Get-ScheduledTask XblGameSaveTaskLogon | Enable-ScheduledTask \n    Get-ScheduledTask  XblGameSaveTask | Enable-ScheduledTask \n    Get-ScheduledTask  Consolidator | Enable-ScheduledTask \n    Get-ScheduledTask  UsbCeip | Enable-ScheduledTask \n    Get-ScheduledTask  DmClient | Enable-ScheduledTask \n    Get-ScheduledTask  DmClientOnScenarioDownload | Enable-ScheduledTask \n\n    Write-Output \"Re-enabling and starting WAP Push Service\"\n    #Enable and start WAP Push Service\n\tSet-Service \"dmwappushservice\" -StartupType Automatic\n    Start-Service \"dmwappushservice\"\n    \n    Write-Output \"Re-enabling and starting the Diagnostics Tracking Service\"\n    #Enabling the Diagnostics Tracking Service\n\tSet-Service \"DiagTrack\" -StartupType Automatic\n\tStart-Service \"DiagTrack\"\n\t\n#\t# Re-Enable the showing of last used files and folders (luff)\n#    Write-Output \"Re-enabling keys to show last used files and folders\"\n#\t$luffKeys = @(\n#\t\t\"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HomeFolderDesktop\\NameSpace\\DelegateFolders\\{3134ef9c-6b18-4996-ad04-ed5912e00eb5}\"\n#\t\t\"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HomeFolderDesktop\\NameSpace\\DelegateFolders\\{3936E9E4-D92C-4EEE-A85A-BC16D5EA0819}\"\n#\t)\n#\tForEach ($luffKey in $luffKeys) {\n#\t\tIf (! (Test-Path $lastUsedFiles)) {\n#\t\t\tWrite-Output \"Adding $luffKey to registry\"\n#\t\t\tNew-Item $luffKey\n#\t\t}\n#    }\n#    Write-Output \"Re-enabling explorer to show last used files and folders\"\n#\t$explorerLastUsed = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\"\n#\tSet-ItemProperty $explorerLastUsed HubMode -Value 0\n#\t\n#\t# Re-Enable AeroShake\n#\tWrite-Output \"Re-enabling AeroShake\"\n#\t$aeroShake = \"HKCU:\\Software\\Policies\\Microsoft\\Windows\\Explorer\"\n#\tSet-ItemProperty $aeroShake NoWindowMinimizingShortcuts -Value 0\n#\t\n#\t# Re-Locate Explorer LaunchTo\n#\tWrite-Output \"Re-Locate the Explorers Launch To (Entry Point)\"\n#\t$LaunchTo = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\"\n#\tSet-ItemProperty $LaunchTo LaunchTo -Value 2\n"
  },
  {
    "path": "Individual Scripts/Set Explorers LaunchTo Computer.ps1",
    "content": "# \"This Computer\"-Button starts the explorer on the following path:\n# \tLaunchTo\tValue\tDescription\n#\t\t\t\t1 \t\tComputer (Harddrives, Network, etc.)\n#\t\t\t\t2 \t\tFast Access\n#\t\t\t\t3 \t\tDownloads (The Download-Folder)\n\nWrite-Host \"Set Explorers Entry Point\"\n\t$LaunchTo = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\"\n\tSet-ItemProperty $LaunchTo LaunchTo -Value 1"
  },
  {
    "path": "Individual Scripts/Stop Edge PDF",
    "content": "#Stops edge from taking over as the default .PDF viewer    \n    Write-Output \"Stopping Edge from taking over as the default .PDF viewer\"\n    $NoPDF = \"HKCR:\\.pdf\"\n    $NoProgids = \"HKCR:\\.pdf\\OpenWithProgids\"\n    $NoWithList = \"HKCR:\\.pdf\\OpenWithList\" \n    If (!(Get-ItemProperty $NoPDF  NoOpenWith)) {\n        New-ItemProperty $NoPDF NoOpenWith \n    }        \n    If (!(Get-ItemProperty $NoPDF  NoStaticDefaultVerb)) {\n        New-ItemProperty $NoPDF  NoStaticDefaultVerb \n    }        \n    If (!(Get-ItemProperty $NoProgids  NoOpenWith)) {\n        New-ItemProperty $NoProgids  NoOpenWith \n    }        \n    If (!(Get-ItemProperty $NoProgids  NoStaticDefaultVerb)) {\n        New-ItemProperty $NoProgids  NoStaticDefaultVerb \n    }        \n    If (!(Get-ItemProperty $NoWithList  NoOpenWith)) {\n        New-ItemProperty $NoWithList  NoOpenWith\n    }        \n    If (!(Get-ItemProperty $NoWithList  NoStaticDefaultVerb)) {\n        New-ItemProperty $NoWithList  NoStaticDefaultVerb \n    }\n            \n    #Appends an underscore '_' to the Registry key for Edge\n    $Edge = \"HKCR:\\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_\"\n    If (Test-Path $Edge) {\n        Set-Item $Edge AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_ \n    }\n"
  },
  {
    "path": "Individual Scripts/Uninstall OneDrive",
    "content": "Write-Output \"Uninstalling OneDrive. Please wait.\"\n    \n    New-PSDrive  HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT\n    $onedrive = \"$env:SYSTEMROOT\\SysWOW64\\OneDriveSetup.exe\"\n    $ExplorerReg1 = \"HKCR:\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\"\n    $ExplorerReg2 = \"HKCR:\\Wow6432Node\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\"\n\tStop-Process -Name \"OneDrive*\"\n\tStart-Sleep 2\n\tIf (!(Test-Path $onedrive)) {\n\t\t$onedrive = \"$env:SYSTEMROOT\\System32\\OneDriveSetup.exe\"\n\t}\n\tStart-Process $onedrive \"/uninstall\" -NoNewWindow -Wait\n\tStart-Sleep 2\n    Write-Output \"Stopping explorer\"\n    Start-Sleep 1\n\t.\\taskkill.exe /F /IM explorer.exe\n\tStart-Sleep 3\n    Write-Output \"Removing leftover files\"\n\tRemove-Item \"$env:USERPROFILE\\OneDrive\" -Force -Recurse\n\tRemove-Item \"$env:LOCALAPPDATA\\Microsoft\\OneDrive\" -Force -Recurse\n\tRemove-Item \"$env:PROGRAMDATA\\Microsoft OneDrive\" -Force -Recurse\n\tIf (Test-Path \"$env:SYSTEMDRIVE\\OneDriveTemp\") {\n\t\tRemove-Item \"$env:SYSTEMDRIVE\\OneDriveTemp\" -Force -Recurse\n\t}\n    Write-Output \"Removing OneDrive from windows explorer\"\n    If (!(Test-Path $ExplorerReg1)) {\n        New-Item $ExplorerReg1\n    }\n    Set-ItemProperty $ExplorerReg1 System.IsPinnedToNameSpaceTree -Value 0 \n    If (!(Test-Path $ExplorerReg2)) {\n        New-Item $ExplorerReg2\n    }\n    Set-ItemProperty $ExplorerReg2 System.IsPinnedToNameSpaceTree -Value 0\n    Write-Output \"Restarting Explorer that was shut down before.\"\n    Start explorer.exe -NoNewWindow\n"
  },
  {
    "path": "Individual Scripts/Unpin Start",
    "content": "# https://superuser.com/a/1442733\n#Requires -RunAsAdministrator\n\n$START_MENU_LAYOUT = @\"\n<LayoutModificationTemplate xmlns:defaultlayout=\"http://schemas.microsoft.com/Start/2014/FullDefaultLayout\" xmlns:start=\"http://schemas.microsoft.com/Start/2014/StartLayout\" Version=\"1\" xmlns:taskbar=\"http://schemas.microsoft.com/Start/2014/TaskbarLayout\" xmlns=\"http://schemas.microsoft.com/Start/2014/LayoutModification\">\n    <LayoutOptions StartTileGroupCellWidth=\"6\" />\n    <DefaultLayoutOverride>\n        <StartLayoutCollection>\n            <defaultlayout:StartLayout GroupCellWidth=\"6\" />\n        </StartLayoutCollection>\n    </DefaultLayoutOverride>\n</LayoutModificationTemplate>\n\"@\n\n$layoutFile=\"C:\\Windows\\StartMenuLayout.xml\"\n\n#Delete layout file if it already exists\nIf(Test-Path $layoutFile)\n{\n    Remove-Item $layoutFile\n}\n\n#Creates the blank layout file\n$START_MENU_LAYOUT | Out-File $layoutFile -Encoding ASCII\n\n$regAliases = @(\"HKLM\", \"HKCU\")\n\n#Assign the start layout and force it to apply with \"LockedStartLayout\" at both the machine and user level\nforeach ($regAlias in $regAliases){\n    $basePath = $regAlias + \":\\SOFTWARE\\Policies\\Microsoft\\Windows\"\n    $keyPath = $basePath + \"\\Explorer\" \n    IF(!(Test-Path -Path $keyPath)) { \n        New-Item -Path $basePath -Name \"Explorer\"\n    }\n    Set-ItemProperty -Path $keyPath -Name \"LockedStartLayout\" -Value 1\n    Set-ItemProperty -Path $keyPath -Name \"StartLayoutFile\" -Value $layoutFile\n}\n\n#Restart Explorer, open the start menu (necessary to load the new layout), and give it a few seconds to process\nStop-Process -name explorer\nStart-Sleep -s 5\n$wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('^{ESCAPE}')\nStart-Sleep -s 5\n\n#Enable the ability to pin items again by disabling \"LockedStartLayout\"\nforeach ($regAlias in $regAliases){\n    $basePath = $regAlias + \":\\SOFTWARE\\Policies\\Microsoft\\Windows\"\n    $keyPath = $basePath + \"\\Explorer\" \n    Set-ItemProperty -Path $keyPath -Name \"LockedStartLayout\" -Value 0\n}\n\n#Restart Explorer and delete the layout file\nStop-Process -name explorer\n\n# Uncomment the next line to make clean start menu default for all new users\n#Import-StartLayout -LayoutPath $layoutFile -MountPath $env:SystemDrive\\\n\nRemove-Item $layoutFile\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2017 Richard Newton\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# Windows10Debloater\n\n[![made-with-powershell](https://img.shields.io/badge/PowerShell-1f425f?logo=Powershell)](https://microsoft.com/PowerShell)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nScript/Utility/Application to debloat Windows 10, to remove Windows pre-installed unnecessary applications, stop some telemetry functions, stop Cortana from being used as your Search Index, disable unnecessary scheduled tasks, and more...\n\n## Donate a cup of coffee\n<a href=\"https://www.buymeacoffee.com/HZNh7w1Bm\" target=\"_blank\"><img src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" ></a>\n\nBe sure to look at the Contributors' GitHubs to see if they have GitHub sponsorships as well since they have contributed to this open-source project. (https://github.com/Sycnex/Windows10Debloater/graphs/contributors)\n\n## Disclaimer\n\n**WARNING:** I do **NOT** take responsibility for what may happen to your system! Run scripts at your own risk!\nAlso, other variants of this repo are not technically \"new\" versions of this, but they are different in their own respective ways. There are some sites saying that other projects are \"new\" versions of this, but that is inaccurate. \n\n## How To Run the Windows10Debloater.ps1 and the Windows10DebloaterGUI.ps1 files\n\nThere are different methods of running the PowerShell script. The methods are as follows:\n\n### First Method\n\n1) Download the .zip file on the main page of the GitHub and extract the .zip file to your desired location\n2) Once extracted, open [PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/overview?view=powershell-5.1) (or [PowerShell ISE](https://docs.microsoft.com/en-us/powershell/scripting/windows-powershell/ise/introducing-the-windows-powershell-ise?view=powershell-7)) as an Administrator\n3) Enable PowerShell execution\n<code>Set-ExecutionPolicy Unrestricted -Force</code>\n4) On the prompt, change to the directory where you extracted the files:\n  e.g. - `cd c:\\temp`\n5) Next, to run either script, enter in the following:\n  e.g. - `.\\Windows10DebloaterGUI.ps1`\n\n### Second Method\n\n1) Download the .zip file on the main page of the GitHub and extract the .zip file to your desired location\n2) Right-click the PowerShell file that you'd like to run and click on \"Run With PowerShell\"\n3) This will allow the script to run without having to do the above steps but Powershell will ask if you're sure you want to run this script.\n\nRemember this script **NEEDS** to be run as admin in order to function properly.\n\n## How To Run the Windows10SysPrepDebloater.ps1 file\n\nFor the WindowsSysPrepDebloater.ps1 file, there are a couple of parameters that you can run so that you can specify which functions are used. The parameters are:\n`-SysPrep`, `-Debloat` and `-Privacy`.\n\nTo run this with parameters, do the following:\n\n1) Download the .zip file on the main page of the GitHub and extract the .zip file to your desired location\n2) Once extracted, open [PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/overview?view=powershell-5.1) (or [PowerShell ISE](https://docs.microsoft.com/en-us/powershell/scripting/windows-powershell/ise/introducing-the-windows-powershell-ise?view=powershell-7)) as an Administrator\n3) On the prompt, change to the directory where you extracted the files:\n  e.g. - `cd c:\\temp`\n4) Next, to run either script, enter in the following:\n\n  e.g. - `.\\Windows10SysPrepDebloater.ps1 -Sysprep -Debloat -Privacy`\n\n\n## Sysprep, Interactive, and GUI Application\n\nThere are now 3 versions of **Windows10Debloater** - There is an interactive version, a GUI app version, and a pure silent version.\n\n- **`Windows10SysPrepDebloater.ps1`** -> The silent version now utilizes the switch parameters: -Sysprep, -Debloat -Privacy. The silent version can be useful for deploying MDT Images/sysprepping or any other way you deploy Windows 10. This will work to remove the bloatware during the deployment process.\n\n- **`Windows10Debloater.ps1`** -> This interactive version is what it implies - a Windows10Debloater script with interactive prompts. This one should not be used for deployments that require a silent script with optional parameters. This script gives you choices with prompts as it runs so that you can make the choices of what the script does.\n\n- **`Windows10DebloaterGUI.ps1`** -> There is now a GUI Application named Windows10DebloaterGUI.ps1 with buttons to perform all of the functions that the scripts do. This is better for the average user who does not want to work with code, or if you'd prefer to just see an application screen. \n\n## Switch Parameters\n\nThere are 3 switch parameters in the `Windows10SysPrepDebloater.ps1` script.\n\n- **`-SysPrep`**, which runs the command within a function: get-appxpackage | remove-appxpackage. This is useful since some administrators need that command to run first in order for machines to be able to properly provision the apps for removal.\n\n- **`-Debloat`**, switch parameter which does as it suggests. It runs the following functions: Start-Debloat, Remove-Keys, and Protect-Privacy.\nRemove-Keys removes registry keys leftover that are associated with the bloatware apps listed above, but not removed during the Start-Debloat function.\n\n- **`-Privacy`**, adds and/or changes registry keys to stop some telemetry functions, stops Cortana from being used as your Search Index, disables \"unnecessary\" scheduled tasks, and more.\n\n***This script will remove the bloatware from Windows 10 when using Remove-AppXPackage/Remove-AppXProvisionedPackage, and then delete specific registry keys that are were not removed beforehand. For best results, this script should be run before a user profile is configured, otherwise, you will likely see that apps that should have been removed will remain, and if they are removed you will find broken tiles on the start menu.***\n\n## These registry keys are\n\nEclipseManager,\nActiproSoftwareLLC,\nMicrosoft.PPIProjection,\nMicrosoft.XboxGameCallableUI\n\nYou can choose to either 'Debloat' or 'Revert'. Depending on your choice, either one will run specific code to either debloat your Windows 10 machine.\n\n## The Debloat switch choice runs the following functions\n\nDebloat,\nRemove-Keys,\nProtect-Privacy,\nStop-EdgePDF (If chosen)\n\n## The Revert switch choice runs the following functions\n\nRevert-Changes,\nEnable-EdgePDF\n\nThe Revert option reinstalls the bloatware and changes your registry keys back to default. \n\n## The scheduled tasks that are disabled are\n\nXblGameSaveTaskLogon,\nXblGameSaveTask,\nConsolidator,\nUsbCeip,\nDmClient\n\nThese scheduled tasks that are disabled have absolutely no impact on the function of the OS.\n\n## Bloatware that is removed\n\n[3DBuilder](https://www.microsoft.com/en-us/p/3d-builder/9wzdncrfj3t6),\n[ActiproSoftware](https://www.microsoft.com/en-us/p/actipro-universal-windows-controls/9wzdncrdlvzp),\n[Alarms](https://www.microsoft.com/en-us/p/windows-alarms-clock/9wzdncrfj3pr?activetab=pivot:overviewtab),\n[Appconnector](https://www.microsoft.com/en-us/p/connector/9wzdncrdjmlj?activetab=pivot:overviewtab),\n[Asphalt8](https://www.microsoft.com/en-us/p/asphalt-8-racing-game-drive-drift-at-real-speed/9wzdncrfj26j?activetab=pivot:overviewtab),\n[Autodesk SketchBook](https://www.microsoft.com/en-us/p/autodesk-sketchbook/9nblggh4vzw5),\n[MSN Money](https://www.microsoft.com/en-us/p/msn-money/9wzdncrfhv4v?activetab=pivot:overviewtab),\n[Food And Drink](https://www.microsoft.com/en-us/p/food-and-drink/9nblggh0jhqg),\n[Health And Fitness](https://www.microsoft.com/en-us/p/health-fitness-free/9wzdncrcwcdp),\n[Microsoft News](https://www.microsoft.com/en-us/p/microsoft-news/9wzdncrfhvfw#activetab=pivot:overviewtab),\n[MSN Sports](https://www.microsoft.com/en-us/p/msn-sports/9wzdncrfhvh4?activetab=pivot:overviewtab),\n[MSN Travel](https://www.microsoft.com/en-us/p/msn-travel/9wzdncrfj3ft?activetab=pivot:overviewtab),\n[MSN Weather](https://www.microsoft.com/en-us/p/msn-weather/9wzdncrfj3q2?activetab=pivot:overviewtab),\nBioEnrollment,\n[Windows Camera](https://www.microsoft.com/en-us/p/windows-camera/9wzdncrfjbbg#activetab=pivot:overviewtab),\nCandyCrush,\nCandyCrushSoda,\nCaesars Slots Free Casino,\nContactSupport,\nCyberLink MediaSuite Essentials,\nDrawboardPDF,\nDuolingo,\nEclipseManager,\nFacebook,\nFarmVille 2 Country Escape,\nFlipboard,\nFresh Paint,\nGet started,\niHeartRadio,\nKing apps,\nMaps,\nMarch of Empires,\nMessaging,\nMicrosoft Office Hub,\nMicrosoft Solitaire Collection,\nMicrosoft Sticky Notes,\nMinecraft,\nNetflix,\nNetwork Speed Test,\nNYT Crossword,\nOffice Sway,\nOneNote,\nOneConnect,\nPandora,\nPeople,\nPhone,\nPhototastic Collage,\nPicsArt-PhotoStudio,\nPowerBI,\nRoyal Revolt 2,\nShazam,\nSkype for Desktop,\nSoundRecorder,\nTuneInRadio,\nTwitter,\nWindows communications apps,\nWindows Feedback,\nWindows Feedback Hub,\nWindows Reading List,\nXboxApp,\nXbox Game CallableUI,\nXbox Identity Provider,\nZune Music,\nZune Video.\n\n## Quick download link\n\n`iwr -useb https://git.io/debloat|iex`\n\n## Allowlist and Blocklist\nThere may be some confusion, but when using the Allowlist/Blocklist, the checkmark means it is on the blocklist, and that it will be removed.\n\n## Credits\n\nThank you to [a60wattfish](https://github.com/a60wattfish), [abulgatz](abulgatz), [xsisbest](https://github.com/xsisbest), [Damian](https://github.com/Damian), [Vikingat-RAGE](https://github.com/Vikingat-RAGE), Reddit user [/u/GavinEke](https://github.com/GavinEke), and all of the contributors (https://github.com/Sycnex/Windows10Debloater/graphs/contributors) for the suggestions, code, changes, and fixes that you have all graciously worked hard on and shared! You all have done a fantastic job!\n"
  },
  {
    "path": "Windows10Debloater.ps1",
    "content": "#This function finds any AppX/AppXProvisioned package and uninstalls it, except for Freshpaint, Windows Calculator, Windows Store, and Windows Photos.\n#Also, to note - This does NOT remove essential system services/software/etc such as .NET framework installations, Cortana, Edge, etc.\n\n#This will self elevate the script so with a UAC prompt since this script needs to be run as an Administrator in order to function properly.\nIf (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]'Administrator')) {\n    Write-Host \"You didn't run this script as an Administrator. This script will self elevate to run as an Administrator and continue.\"\n    Start-Sleep 1\n    Write-Host \"                                               3\"\n    Start-Sleep 1\n    Write-Host \"                                               2\"\n    Start-Sleep 1\n    Write-Host \"                                               1\"\n    Start-Sleep 1\n    Start-Process powershell.exe -ArgumentList (\"-NoProfile -ExecutionPolicy Bypass -File `\"{0}`\"\" -f $PSCommandPath) -Verb RunAs\n    Exit\n}\n\n#no errors throughout\n$ErrorActionPreference = 'silentlycontinue'\n\n$DebloatFolder = \"C:\\Temp\\Windows10Debloater\"\nIf (Test-Path $DebloatFolder) {\n    Write-Output \"$DebloatFolder exists. Skipping.\"\n}\nElse {\n    Write-Output \"The folder '$DebloatFolder' doesn't exist. This folder will be used for storing logs created after the script runs. Creating now.\"\n    Start-Sleep 1\n    New-Item -Path \"$DebloatFolder\" -ItemType Directory\n    Write-Output \"The folder $DebloatFolder was successfully created.\"\n}\n\nStart-Transcript -OutputDirectory \"$DebloatFolder\"\n\nAdd-Type -AssemblyName PresentationCore, PresentationFramework\n\nFunction DebloatAll {\n    #Removes AppxPackages\n    #Credit to /u/GavinEke for a modified version of my whitelist code\n    $WhitelistedApps = 'Microsoft.ScreenSketch|Microsoft.Paint3D|Microsoft.WindowsCalculator|Microsoft.WindowsStore|Microsoft.Windows.Photos|CanonicalGroupLimited.UbuntuonWindows|`\n    Microsoft.XboxGameCallableUI|Microsoft.XboxGamingOverlay|Microsoft.Xbox.TCUI|Microsoft.XboxGamingOverlay|Microsoft.XboxIdentityProvider|Microsoft.MicrosoftStickyNotes|Microsoft.MSPaint|Microsoft.WindowsCamera|.NET|Framework|`\n    Microsoft.HEIFImageExtension|Microsoft.ScreenSketch|Microsoft.StorePurchaseApp|Microsoft.VP9VideoExtensions|Microsoft.WebMediaExtensions|Microsoft.WebpImageExtension|Microsoft.DesktopAppInstaller|WindSynthBerry|MIDIBerry|Slack'\n    #NonRemovable Apps that where getting attempted and the system would reject the uninstall, speeds up debloat and prevents 'initalizing' overlay when removing apps\n    $NonRemovable = '1527c705-839a-4832-9118-54d4Bd6a0c89|c5e2524a-ea46-4f67-841f-6a9465d9d515|E2A4F912-2574-4A75-9BB0-0D023378592B|F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE|InputApp|Microsoft.AAD.BrokerPlugin|Microsoft.AccountsControl|`\n    Microsoft.BioEnrollment|Microsoft.CredDialogHost|Microsoft.ECApp|Microsoft.LockApp|Microsoft.MicrosoftEdgeDevToolsClient|Microsoft.MicrosoftEdge|Microsoft.PPIProjection|Microsoft.Win32WebViewHost|Microsoft.Windows.Apprep.ChxApp|`\n    Microsoft.Windows.AssignedAccessLockApp|Microsoft.Windows.CapturePicker|Microsoft.Windows.CloudExperienceHost|Microsoft.Windows.ContentDeliveryManager|Microsoft.Windows.Cortana|Microsoft.Windows.NarratorQuickStart|`\n    Microsoft.Windows.ParentalControls|Microsoft.Windows.PeopleExperienceHost|Microsoft.Windows.PinningConfirmationDialog|Microsoft.Windows.SecHealthUI|Microsoft.Windows.SecureAssessmentBrowser|Microsoft.Windows.ShellExperienceHost|`\n    Microsoft.Windows.XGpuEjectDialog|Microsoft.XboxGameCallableUI|Windows.CBSPreview|windows.immersivecontrolpanel|Windows.PrintDialog|Microsoft.VCLibs.140.00|Microsoft.Services.Store.Engagement|Microsoft.UI.Xaml.2.0|*Nvidia*'\n    Get-AppxPackage -AllUsers | Where-Object {$_.Name -NotMatch $WhitelistedApps -and $_.Name -NotMatch $NonRemovable} | Remove-AppxPackage\n    Get-AppxPackage | Where-Object {$_.Name -NotMatch $WhitelistedApps -and $_.Name -NotMatch $NonRemovable} | Remove-AppxPackage\n    Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName -NotMatch $WhitelistedApps -and $_.PackageName -NotMatch $NonRemovable} | Remove-AppxProvisionedPackage -Online\n}\n\nFunction DebloatBlacklist {\n\n    $Bloatware = @(\n\n        #Unnecessary Windows 10 AppX Apps\n        \"Microsoft.BingNews\"\n        \"Microsoft.GetHelp\"\n        \"Microsoft.Getstarted\"\n        \"Microsoft.Messaging\"\n        \"Microsoft.Microsoft3DViewer\"\n        \"Microsoft.MicrosoftOfficeHub\"\n        \"Microsoft.MicrosoftSolitaireCollection\"\n        \"Microsoft.NetworkSpeedTest\"\n        \"Microsoft.News\"\n        \"Microsoft.Office.Lens\"\n        \"Microsoft.Office.OneNote\"\n        \"Microsoft.Office.Sway\"\n        \"Microsoft.OneConnect\"\n        \"Microsoft.People\"\n        \"Microsoft.Print3D\"\n        \"Microsoft.RemoteDesktop\"\n        \"Microsoft.SkypeApp\"\n        \"Microsoft.StorePurchaseApp\"\n        \"Microsoft.Office.Todo.List\"\n        \"Microsoft.Whiteboard\"\n        \"Microsoft.WindowsAlarms\"\n        #\"Microsoft.WindowsCamera\"\n        \"microsoft.windowscommunicationsapps\"\n        \"Microsoft.WindowsFeedbackHub\"\n        \"Microsoft.WindowsMaps\"\n        \"Microsoft.WindowsSoundRecorder\"\n        \"Microsoft.Xbox.TCUI\"\n        \"Microsoft.XboxApp\"\n        \"Microsoft.XboxGameOverlay\"\n        \"Microsoft.XboxIdentityProvider\"\n        \"Microsoft.XboxSpeechToTextOverlay\"\n        \"Microsoft.ZuneMusic\"\n        \"Microsoft.ZuneVideo\"\n\n        #Sponsored Windows 10 AppX Apps\n        #Add sponsored/featured apps to remove in the \"*AppName*\" format\n        \"*EclipseManager*\"\n        \"*ActiproSoftwareLLC*\"\n        \"*AdobeSystemsIncorporated.AdobePhotoshopExpress*\"\n        \"*Duolingo-LearnLanguagesforFree*\"\n        \"*PandoraMediaInc*\"\n        \"*CandyCrush*\"\n        \"*BubbleWitch3Saga*\"\n        \"*Wunderlist*\"\n        \"*Flipboard*\"\n        \"*Twitter*\"\n        \"*Facebook*\"\n        \"*Spotify*\"\n        \"*Minecraft*\"\n        \"*Royal Revolt*\"\n        \"*Sway*\"\n        \"*Speed Test*\"\n        \"*Dolby*\"\n             \n        #Optional: Typically not removed but you can if you need to for some reason\n        #\"*Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe*\"\n        #\"*Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe*\"\n        #\"*Microsoft.BingWeather*\"\n        #\"*Microsoft.MSPaint*\"\n        #\"*Microsoft.MicrosoftStickyNotes*\"\n        #\"*Microsoft.Windows.Photos*\"\n        #\"*Microsoft.WindowsCalculator*\"\n        #\"*Microsoft.WindowsStore*\"\n    )\n    foreach ($Bloat in $Bloatware) {\n        Get-AppxPackage -Name $Bloat| Remove-AppxPackage\n        Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $Bloat | Remove-AppxProvisionedPackage -Online\n        Write-Output \"Trying to remove $Bloat.\"\n    }\n}\n\nFunction Remove-Keys {\n        \n    #These are the registry keys that it will delete.\n            \n    $Keys = @(\n            \n        #Remove Background Tasks\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy\"\n            \n        #Windows File\n        \"HKCR:\\Extensions\\ContractId\\Windows.File\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n            \n        #Registry keys to delete if they aren't uninstalled by RemoveAppXPackage/RemoveAppXProvisionedPackage\n        \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy\"\n            \n        #Scheduled Tasks to delete\n        \"HKCR:\\Extensions\\ContractId\\Windows.PreInstalledConfigTask\\PackageId\\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe\"\n            \n        #Windows Protocol Keys\n        \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy\"\n               \n        #Windows Share Target\n        \"HKCR:\\Extensions\\ContractId\\Windows.ShareTarget\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n    )\n        \n    #This writes the output of each key it is removing and also removes the keys listed above.\n    ForEach ($Key in $Keys) {\n        Write-Output \"Removing $Key from registry\"\n        Remove-Item $Key -Recurse\n    }\n}\n            \nFunction Protect-Privacy {\n            \n    #Disables Windows Feedback Experience\n    Write-Output \"Disabling Windows Feedback Experience program\"\n    $Advertising = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AdvertisingInfo\"\n    If (Test-Path $Advertising) {\n        Set-ItemProperty $Advertising Enabled -Value 0 \n    }\n            \n    #Stops Cortana from being used as part of your Windows Search Function\n    Write-Output \"Stopping Cortana from being used as part of your Windows Search Function\"\n    $Search = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\"\n    If (Test-Path $Search) {\n        Set-ItemProperty $Search AllowCortana -Value 0 \n    }\n\n    #Disables Web Search in Start Menu\n    Write-Output \"Disabling Bing Search in Start Menu\"\n    $WebSearch = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\"\n    Set-ItemProperty \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Search\" BingSearchEnabled -Value 0 \n    If (!(Test-Path $WebSearch)) {\n        New-Item $WebSearch\n    }\n    Set-ItemProperty $WebSearch DisableWebSearch -Value 1 \n            \n    #Stops the Windows Feedback Experience from sending anonymous data\n    Write-Output \"Stopping the Windows Feedback Experience program\"\n    $Period = \"HKCU:\\Software\\Microsoft\\Siuf\\Rules\"\n    If (!(Test-Path $Period)) { \n        New-Item $Period\n    }\n    Set-ItemProperty $Period PeriodInNanoSeconds -Value 0 \n\n    #Prevents bloatware applications from returning and removes Start Menu suggestions               \n    Write-Output \"Adding Registry key to prevent bloatware apps from returning\"\n    $registryPath = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\"\n    $registryOEM = \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\"\n    If (!(Test-Path $registryPath)) { \n        New-Item $registryPath\n    }\n    Set-ItemProperty $registryPath DisableWindowsConsumerFeatures -Value 1 \n\n    If (!(Test-Path $registryOEM)) {\n        New-Item $registryOEM\n    }\n    Set-ItemProperty $registryOEM  ContentDeliveryAllowed -Value 0 \n    Set-ItemProperty $registryOEM  OemPreInstalledAppsEnabled -Value 0 \n    Set-ItemProperty $registryOEM  PreInstalledAppsEnabled -Value 0 \n    Set-ItemProperty $registryOEM  PreInstalledAppsEverEnabled -Value 0 \n    Set-ItemProperty $registryOEM  SilentInstalledAppsEnabled -Value 0 \n    Set-ItemProperty $registryOEM  SystemPaneSuggestionsEnabled -Value 0          \n    \n    #Preping mixed Reality Portal for removal    \n    Write-Output \"Setting Mixed Reality Portal value to 0 so that you can uninstall it in Settings\"\n    $Holo = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Holographic\"    \n    If (Test-Path $Holo) {\n        Set-ItemProperty $Holo  FirstRunSucceeded -Value 0 \n    }\n\n    #Disables Wi-fi Sense\n    Write-Output \"Disabling Wi-Fi Sense\"\n    $WifiSense1 = \"HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\default\\WiFi\\AllowWiFiHotSpotReporting\"\n    $WifiSense2 = \"HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\default\\WiFi\\AllowAutoConnectToWiFiSenseHotspots\"\n    $WifiSense3 = \"HKLM:\\SOFTWARE\\Microsoft\\WcmSvc\\wifinetworkmanager\\config\"\n    If (!(Test-Path $WifiSense1)) {\n        New-Item $WifiSense1\n    }\n    Set-ItemProperty $WifiSense1  Value -Value 0 \n    If (!(Test-Path $WifiSense2)) {\n        New-Item $WifiSense2\n    }\n    Set-ItemProperty $WifiSense2  Value -Value 0 \n    Set-ItemProperty $WifiSense3  AutoConnectAllowedOEM -Value 0 \n        \n    #Disables live tiles\n    Write-Output \"Disabling live tiles\"\n    $Live = \"HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CurrentVersion\\PushNotifications\"    \n    If (!(Test-Path $Live)) {      \n        New-Item $Live\n    }\n    Set-ItemProperty $Live  NoTileApplicationNotification -Value 1 \n        \n    #Turns off Data Collection via the AllowTelemtry key by changing it to 0\n    Write-Output \"Turning off Data Collection\"\n    $DataCollection1 = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection\"\n    $DataCollection2 = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection\"\n    $DataCollection3 = \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection\"    \n    If (Test-Path $DataCollection1) {\n        Set-ItemProperty $DataCollection1  AllowTelemetry -Value 0 \n    }\n    If (Test-Path $DataCollection2) {\n        Set-ItemProperty $DataCollection2  AllowTelemetry -Value 0 \n    }\n    If (Test-Path $DataCollection3) {\n        Set-ItemProperty $DataCollection3  AllowTelemetry -Value 0 \n    }\n    \n    #Disabling Location Tracking\n    Write-Output \"Disabling Location Tracking\"\n    $SensorState = \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Sensor\\Overrides\\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}\"\n    $LocationConfig = \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\lfsvc\\Service\\Configuration\"\n    If (!(Test-Path $SensorState)) {\n        New-Item $SensorState\n    }\n    Set-ItemProperty $SensorState SensorPermissionState -Value 0 \n    If (!(Test-Path $LocationConfig)) {\n        New-Item $LocationConfig\n    }\n    Set-ItemProperty $LocationConfig Status -Value 0 \n        \n    #Disables People icon on Taskbar\n    Write-Output \"Disabling People icon on Taskbar\"\n    $People = 'HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\People'\n    If (Test-Path $People) {\n        Set-ItemProperty $People -Name PeopleBand -Value 0\n    }\n        \n    #Disables scheduled tasks that are considered unnecessary \n    Write-Output \"Disabling scheduled tasks\"\n    Get-ScheduledTask  XblGameSaveTaskLogon | Disable-ScheduledTask\n    Get-ScheduledTask  XblGameSaveTask | Disable-ScheduledTask\n    Get-ScheduledTask  Consolidator | Disable-ScheduledTask\n    Get-ScheduledTask  UsbCeip | Disable-ScheduledTask\n    Get-ScheduledTask  DmClient | Disable-ScheduledTask\n    Get-ScheduledTask  DmClientOnScenarioDownload | Disable-ScheduledTask\n\n    Write-Output \"Stopping and disabling Diagnostics Tracking Service\"\n    #Disabling the Diagnostics Tracking Service\n    Stop-Service \"DiagTrack\"\n    Set-Service \"DiagTrack\" -StartupType Disabled\n\n    \n    Write-Output \"Removing CloudStore from registry if it exists\"\n    $CloudStore = 'HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\CloudStore'\n    If (Test-Path $CloudStore) {\n        Stop-Process Explorer.exe -Force\n        Remove-Item $CloudStore -Recurse -Force\n        Start-Process Explorer.exe -Wait\n    }\n}\n\nFunction DisableCortana {\n    Write-Host \"Disabling Cortana\"\n    $Cortana1 = \"HKCU:\\SOFTWARE\\Microsoft\\Personalization\\Settings\"\n    $Cortana2 = \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\"\n    $Cortana3 = \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\\TrainedDataStore\"\n    If (!(Test-Path $Cortana1)) {\n        New-Item $Cortana1\n    }\n    Set-ItemProperty $Cortana1 AcceptedPrivacyPolicy -Value 0 \n    If (!(Test-Path $Cortana2)) {\n        New-Item $Cortana2\n    }\n    Set-ItemProperty $Cortana2 RestrictImplicitTextCollection -Value 1 \n    Set-ItemProperty $Cortana2 RestrictImplicitInkCollection -Value 1 \n    If (!(Test-Path $Cortana3)) {\n        New-Item $Cortana3\n    }\n    Set-ItemProperty $Cortana3 HarvestContacts -Value 0\n    \n}\n\nFunction EnableCortana {\n    Write-Host \"Re-enabling Cortana\"\n    $Cortana1 = \"HKCU:\\SOFTWARE\\Microsoft\\Personalization\\Settings\"\n    $Cortana2 = \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\"\n    $Cortana3 = \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\\TrainedDataStore\"\n    If (!(Test-Path $Cortana1)) {\n        New-Item $Cortana1\n    }\n    Set-ItemProperty $Cortana1 AcceptedPrivacyPolicy -Value 1 \n    If (!(Test-Path $Cortana2)) {\n        New-Item $Cortana2\n    }\n    Set-ItemProperty $Cortana2 RestrictImplicitTextCollection -Value 0 \n    Set-ItemProperty $Cortana2 RestrictImplicitInkCollection -Value 0 \n    If (!(Test-Path $Cortana3)) {\n        New-Item $Cortana3\n    }\n    Set-ItemProperty $Cortana3 HarvestContacts -Value 1 \n}\n        \nFunction Stop-EdgePDF {\n    \n    #Stops edge from taking over as the default .PDF viewer    \n    Write-Output \"Stopping Edge from taking over as the default .PDF viewer\"\n    $NoPDF = \"HKCR:\\.pdf\"\n    $NoProgids = \"HKCR:\\.pdf\\OpenWithProgids\"\n    $NoWithList = \"HKCR:\\.pdf\\OpenWithList\" \n    If (!(Get-ItemProperty $NoPDF  NoOpenWith)) {\n        New-ItemProperty $NoPDF NoOpenWith \n    }        \n    If (!(Get-ItemProperty $NoPDF  NoStaticDefaultVerb)) {\n        New-ItemProperty $NoPDF  NoStaticDefaultVerb \n    }        \n    If (!(Get-ItemProperty $NoProgids  NoOpenWith)) {\n        New-ItemProperty $NoProgids  NoOpenWith \n    }        \n    If (!(Get-ItemProperty $NoProgids  NoStaticDefaultVerb)) {\n        New-ItemProperty $NoProgids  NoStaticDefaultVerb \n    }        \n    If (!(Get-ItemProperty $NoWithList  NoOpenWith)) {\n        New-ItemProperty $NoWithList  NoOpenWith\n    }        \n    If (!(Get-ItemProperty $NoWithList  NoStaticDefaultVerb)) {\n        New-ItemProperty $NoWithList  NoStaticDefaultVerb \n    }\n            \n    #Appends an underscore '_' to the Registry key for Edge\n    $Edge = \"HKCR:\\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_\"\n    If (Test-Path $Edge) {\n        Set-Item $Edge AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_ \n    }\n}\n\nFunction Revert-Changes {   \n        \n    #This function will revert the changes you made when running the Start-Debloat function.\n        \n    #This line reinstalls all of the bloatware that was removed\n    Get-AppxPackage -AllUsers | ForEach {Add-AppxPackage -Verbose -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"} \n    \n    #Tells Windows to enable your advertising information.    \n    Write-Output \"Re-enabling key to show advertisement information\"\n    $Advertising = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AdvertisingInfo\"\n    If (Test-Path $Advertising) {\n        Set-ItemProperty $Advertising  Enabled -Value 1\n    }\n            \n    #Enables Cortana to be used as part of your Windows Search Function\n    Write-Output \"Re-enabling Cortana to be used in your Windows Search\"\n    $Search = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\"\n    If (Test-Path $Search) {\n        Set-ItemProperty $Search  AllowCortana -Value 1 \n    }\n            \n    #Re-enables the Windows Feedback Experience for sending anonymous data\n    Write-Output \"Re-enabling Windows Feedback Experience\"\n    $Period = \"HKCU:\\Software\\Microsoft\\Siuf\\Rules\"\n    If (!(Test-Path $Period)) { \n        New-Item $Period\n    }\n    Set-ItemProperty $Period PeriodInNanoSeconds -Value 1 \n    \n    #Enables bloatware applications               \n    Write-Output \"Adding Registry key to allow bloatware apps to return\"\n    $registryPath = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\"\n    If (!(Test-Path $registryPath)) {\n        New-Item $registryPath \n    }\n    Set-ItemProperty $registryPath  DisableWindowsConsumerFeatures -Value 0 \n        \n    #Changes Mixed Reality Portal Key 'FirstRunSucceeded' to 1\n    Write-Output \"Setting Mixed Reality Portal value to 1\"\n    $Holo = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Holographic\"\n    If (Test-Path $Holo) {\n        Set-ItemProperty $Holo  FirstRunSucceeded -Value 1 \n    }\n        \n    #Re-enables live tiles\n    Write-Output \"Enabling live tiles\"\n    $Live = \"HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CurrentVersion\\PushNotifications\"\n    If (!(Test-Path $Live)) {\n        New-Item $Live \n    }\n    Set-ItemProperty $Live  NoTileApplicationNotification -Value 0 \n       \n    #Re-enables data collection\n    Write-Output \"Re-enabling data collection\"\n    $DataCollection = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection\"\n    If (!(Test-Path $DataCollection)) {\n        New-Item $DataCollection\n    }\n    Set-ItemProperty $DataCollection  AllowTelemetry -Value 1\n        \n    #Re-enables People Icon on Taskbar\n    Write-Output \"Enabling People icon on Taskbar\"\n    $People = \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\People\"\n    If (!(Test-Path $People)) {\n        New-Item $People \n    }\n    Set-ItemProperty $People  PeopleBand -Value 1 \n    \n    #Re-enables suggestions on start menu\n    Write-Output \"Enabling suggestions on the Start Menu\"\n    $Suggestions = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\"\n    If (!(Test-Path $Suggestions)) {\n        New-Item $Suggestions\n    }\n    Set-ItemProperty $Suggestions  SystemPaneSuggestionsEnabled -Value 1 \n        \n    #Re-enables scheduled tasks that were disabled when running the Debloat switch\n    Write-Output \"Enabling scheduled tasks that were disabled\"\n    Get-ScheduledTask XblGameSaveTaskLogon | Enable-ScheduledTask \n    Get-ScheduledTask  XblGameSaveTask | Enable-ScheduledTask \n    Get-ScheduledTask  Consolidator | Enable-ScheduledTask \n    Get-ScheduledTask  UsbCeip | Enable-ScheduledTask \n    Get-ScheduledTask  DmClient | Enable-ScheduledTask \n    Get-ScheduledTask  DmClientOnScenarioDownload | Enable-ScheduledTask \n\n    Write-Output \"Re-enabling and starting WAP Push Service\"\n    #Enable and start WAP Push Service\n    Set-Service \"dmwappushservice\" -StartupType Automatic\n    Start-Service \"dmwappushservice\"\n    \n    Write-Output \"Re-enabling and starting the Diagnostics Tracking Service\"\n    #Enabling the Diagnostics Tracking Service\n    Set-Service \"DiagTrack\" -StartupType Automatic\n    Start-Service \"DiagTrack\"\n    \n    Write-Output \"Restoring 3D Objects in the 'My Computer' submenu in explorer\"\n    #Restoring 3D Objects in the 'My Computer' submenu in explorer\n    Restore3dObjects\n}\n\nFunction CheckDMWService {\n\n    Param([switch]$Debloat)\n  \n    If (Get-Service -Name dmwappushservice | Where-Object {$_.StartType -eq \"Disabled\"}) {\n        Set-Service -Name dmwappushservice -StartupType Automatic\n    }\n\n    If (Get-Service -Name dmwappushservice | Where-Object {$_.Status -eq \"Stopped\"}) {\n        Start-Service -Name dmwappushservice\n    } \n}\n    \nFunction Enable-EdgePDF {\n    Write-Output \"Setting Edge back to default\"\n    $NoPDF = \"HKCR:\\.pdf\"\n    $NoProgids = \"HKCR:\\.pdf\\OpenWithProgids\"\n    $NoWithList = \"HKCR:\\.pdf\\OpenWithList\"\n    #Sets edge back to default\n    If (Get-ItemProperty $NoPDF  NoOpenWith) {\n        Remove-ItemProperty $NoPDF  NoOpenWith\n    } \n    If (Get-ItemProperty $NoPDF  NoStaticDefaultVerb) {\n        Remove-ItemProperty $NoPDF  NoStaticDefaultVerb \n    }       \n    If (Get-ItemProperty $NoProgids  NoOpenWith) {\n        Remove-ItemProperty $NoProgids  NoOpenWith \n    }        \n    If (Get-ItemProperty $NoProgids  NoStaticDefaultVerb) {\n        Remove-ItemProperty $NoProgids  NoStaticDefaultVerb \n    }        \n    If (Get-ItemProperty $NoWithList  NoOpenWith) {\n        Remove-ItemProperty $NoWithList  NoOpenWith\n    }    \n    If (Get-ItemProperty $NoWithList  NoStaticDefaultVerb) {\n        Remove-ItemProperty $NoWithList  NoStaticDefaultVerb\n    }\n        \n    #Removes an underscore '_' from the Registry key for Edge\n    $Edge2 = \"HKCR:\\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_\"\n    If (Test-Path $Edge2) {\n        Set-Item $Edge2 AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723\n    }\n}\n\nFunction FixWhitelistedApps {\n    \n    If (!(Get-AppxPackage -AllUsers | Select Microsoft.Paint3D, Microsoft.WindowsCalculator, Microsoft.WindowsStore, Microsoft.Windows.Photos)) {\n    \n        #Credit to abulgatz for these 4 lines of code\n        Get-AppxPackage -allusers Microsoft.Paint3D | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n        Get-AppxPackage -allusers Microsoft.WindowsCalculator | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n        Get-AppxPackage -allusers Microsoft.WindowsStore | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n        Get-AppxPackage -allusers Microsoft.Windows.Photos | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"} \n    } \n}\n\nFunction UninstallOneDrive {\n\n    Write-Host \"Checking for pre-existing files and folders located in the OneDrive folders...\"\n    Start-Sleep 1\n    If (Test-Path \"$env:USERPROFILE\\OneDrive\\*\") {\n        Write-Host \"Files found within the OneDrive folder! Checking to see if a folder named OneDriveBackupFiles exists.\"\n        Start-Sleep 1\n              \n        If (Test-Path \"$env:USERPROFILE\\Desktop\\OneDriveBackupFiles\") {\n            Write-Host \"A folder named OneDriveBackupFiles already exists on your desktop. All files from your OneDrive location will be moved to that folder.\" \n        }\n        else {\n            If (!(Test-Path \"$env:USERPROFILE\\Desktop\\OneDriveBackupFiles\")) {\n                Write-Host \"A folder named OneDriveBackupFiles will be created and will be located on your desktop. All files from your OneDrive location will be located in that folder.\"\n                New-item -Path \"$env:USERPROFILE\\Desktop\" -Name \"OneDriveBackupFiles\"-ItemType Directory -Force\n                Write-Host \"Successfully created the folder 'OneDriveBackupFiles' on your desktop.\"\n            }\n        }\n        Start-Sleep 1\n        Move-Item -Path \"$env:USERPROFILE\\OneDrive\\*\" -Destination \"$env:USERPROFILE\\Desktop\\OneDriveBackupFiles\" -Force\n        Write-Host \"Successfully moved all files/folders from your OneDrive folder to the folder 'OneDriveBackupFiles' on your desktop.\"\n        Start-Sleep 1\n        Write-Host \"Proceeding with the removal of OneDrive.\"\n        Start-Sleep 1\n    }\n    Else {\n        Write-Host \"Either the OneDrive folder does not exist or there are no files to be found in the folder. Proceeding with removal of OneDrive.\"\n        Start-Sleep 1\n        Write-Host \"Enabling the Group Policy 'Prevent the usage of OneDrive for File Storage'.\"\n        $OneDriveKey = 'HKLM:Software\\Policies\\Microsoft\\Windows\\OneDrive'\n        If (!(Test-Path $OneDriveKey)) {\n            Mkdir $OneDriveKey\n            Set-ItemProperty $OneDriveKey -Name OneDrive -Value DisableFileSyncNGSC\n        }\n        Set-ItemProperty $OneDriveKey -Name OneDrive -Value DisableFileSyncNGSC\n    }\n\n    Write-Host \"Uninstalling OneDrive. Please wait...\"\n    \n\n    New-PSDrive  HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT\n    $onedrive = \"$env:SYSTEMROOT\\SysWOW64\\OneDriveSetup.exe\"\n    $ExplorerReg1 = \"HKCR:\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\"\n    $ExplorerReg2 = \"HKCR:\\Wow6432Node\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\"\n    Stop-Process -Name \"OneDrive*\"\n    Start-Sleep 2\n    If (!(Test-Path $onedrive)) {\n        $onedrive = \"$env:SYSTEMROOT\\System32\\OneDriveSetup.exe\"\n\n        New-PSDrive  HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT\n        $onedrive = \"$env:SYSTEMROOT\\SysWOW64\\OneDriveSetup.exe\"\n        $ExplorerReg1 = \"HKCR:\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\"\n        $ExplorerReg2 = \"HKCR:\\Wow6432Node\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\"\n        Stop-Process -Name \"OneDrive*\"\n        Start-Sleep 2\n        If (!(Test-Path $onedrive)) {\n            $onedrive = \"$env:SYSTEMROOT\\System32\\OneDriveSetup.exe\"\n        }\n        Start-Process $onedrive \"/uninstall\" -NoNewWindow -Wait\n        Start-Sleep 2\n        Write-Output \"Stopping explorer\"\n        Start-Sleep 1\n        taskkill.exe /F /IM explorer.exe\n        Start-Sleep 3\n        Write-Output \"Removing leftover files\"\n        Remove-Item \"$env:USERPROFILE\\OneDrive\" -Force -Recurse\n        Remove-Item \"$env:LOCALAPPDATA\\Microsoft\\OneDrive\" -Force -Recurse\n        Remove-Item \"$env:PROGRAMDATA\\Microsoft OneDrive\" -Force -Recurse\n        If (Test-Path \"$env:SYSTEMDRIVE\\OneDriveTemp\") {\n            Remove-Item \"$env:SYSTEMDRIVE\\OneDriveTemp\" -Force -Recurse\n        }\n        Write-Output \"Removing OneDrive from windows explorer\"\n        If (!(Test-Path $ExplorerReg1)) {\n            New-Item $ExplorerReg1\n        }\n        Set-ItemProperty $ExplorerReg1 System.IsPinnedToNameSpaceTree -Value 0 \n        If (!(Test-Path $ExplorerReg2)) {\n            New-Item $ExplorerReg2\n        }\n        Set-ItemProperty $ExplorerReg2 System.IsPinnedToNameSpaceTree -Value 0\n        Write-Output \"Restarting Explorer that was shut down before.\"\n        Start-Process explorer.exe -NoNewWindow\n    \n        Write-Host \"Enabling the Group Policy 'Prevent the usage of OneDrive for File Storage'.\"\n        $OneDriveKey = 'HKLM:Software\\Policies\\Microsoft\\Windows\\OneDrive'\n        If (!(Test-Path $OneDriveKey)) {\n            Mkdir $OneDriveKey \n        }\n        Start-Process $onedrive \"/uninstall\" -NoNewWindow -Wait\n        Start-Sleep 2\n        Write-Host \"Stopping explorer\"\n        Start-Sleep 1\n        taskkill.exe /F /IM explorer.exe\n        Start-Sleep 3\n        Write-Host \"Removing leftover files\"\n        If (Test-Path \"$env:USERPROFILE\\OneDrive\") {\n            Remove-Item \"$env:USERPROFILE\\OneDrive\" -Force -Recurse\n        }\n        If (Test-Path \"$env:LOCALAPPDATA\\Microsoft\\OneDrive\") {\n            Remove-Item \"$env:LOCALAPPDATA\\Microsoft\\OneDrive\" -Force -Recurse\n        }\n        If (Test-Path \"$env:PROGRAMDATA\\Microsoft OneDrive\") {\n            Remove-Item \"$env:PROGRAMDATA\\Microsoft OneDrive\" -Force -Recurse\n        }\n        If (Test-Path \"$env:SYSTEMDRIVE\\OneDriveTemp\") {\n            Remove-Item \"$env:SYSTEMDRIVE\\OneDriveTemp\" -Force -Recurse\n        }\n        Write-Host \"Removing OneDrive from windows explorer\"\n        If (!(Test-Path $ExplorerReg1)) {\n            New-Item $ExplorerReg1\n        }\n        Set-ItemProperty $ExplorerReg1 System.IsPinnedToNameSpaceTree -Value 0 \n        If (!(Test-Path $ExplorerReg2)) {\n            New-Item $ExplorerReg2\n        }\n        Set-ItemProperty $ExplorerReg2 System.IsPinnedToNameSpaceTree -Value 0\n        Write-Host \"Restarting Explorer that was shut down before.\"\n        Start-Process explorer.exe -NoNewWindow\n        Write-Host \"OneDrive has been successfully uninstalled!\"\n        \n        Remove-item env:OneDrive\n    }\n}\n\nFunction UnpinStart {\n    # https://superuser.com/a/1442733\n    #Requires -RunAsAdministrator\n\n$START_MENU_LAYOUT = @\"\n<LayoutModificationTemplate xmlns:defaultlayout=\"http://schemas.microsoft.com/Start/2014/FullDefaultLayout\" xmlns:start=\"http://schemas.microsoft.com/Start/2014/StartLayout\" Version=\"1\" xmlns:taskbar=\"http://schemas.microsoft.com/Start/2014/TaskbarLayout\" xmlns=\"http://schemas.microsoft.com/Start/2014/LayoutModification\">\n    <LayoutOptions StartTileGroupCellWidth=\"6\" />\n    <DefaultLayoutOverride>\n        <StartLayoutCollection>\n            <defaultlayout:StartLayout GroupCellWidth=\"6\" />\n        </StartLayoutCollection>\n    </DefaultLayoutOverride>\n</LayoutModificationTemplate>\n\"@\n\n    $layoutFile=\"C:\\Windows\\StartMenuLayout.xml\"\n\n    #Delete layout file if it already exists\n    If(Test-Path $layoutFile)\n    {\n        Remove-Item $layoutFile\n    }\n\n    #Creates the blank layout file\n    $START_MENU_LAYOUT | Out-File $layoutFile -Encoding ASCII\n\n    $regAliases = @(\"HKLM\", \"HKCU\")\n\n    #Assign the start layout and force it to apply with \"LockedStartLayout\" at both the machine and user level\n    foreach ($regAlias in $regAliases){\n        $basePath = $regAlias + \":\\SOFTWARE\\Policies\\Microsoft\\Windows\"\n        $keyPath = $basePath + \"\\Explorer\" \n        IF(!(Test-Path -Path $keyPath)) { \n            New-Item -Path $basePath -Name \"Explorer\"\n        }\n        Set-ItemProperty -Path $keyPath -Name \"LockedStartLayout\" -Value 1\n        Set-ItemProperty -Path $keyPath -Name \"StartLayoutFile\" -Value $layoutFile\n    }\n\n    #Restart Explorer, open the start menu (necessary to load the new layout), and give it a few seconds to process\n    Stop-Process -name explorer\n    Start-Sleep -s 5\n    $wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('^{ESCAPE}')\n    Start-Sleep -s 5\n\n    #Enable the ability to pin items again by disabling \"LockedStartLayout\"\n    foreach ($regAlias in $regAliases){\n        $basePath = $regAlias + \":\\SOFTWARE\\Policies\\Microsoft\\Windows\"\n        $keyPath = $basePath + \"\\Explorer\" \n        Set-ItemProperty -Path $keyPath -Name \"LockedStartLayout\" -Value 0\n    }\n\n    #Restart Explorer and delete the layout file\n    Stop-Process -name explorer\n\n    # Uncomment the next line to make clean start menu default for all new users\n    #Import-StartLayout -LayoutPath $layoutFile -MountPath $env:SystemDrive\\\n\n    Remove-Item $layoutFile\n}\n\nFunction Remove3dObjects {\n    #Removes 3D Objects from the 'My Computer' submenu in explorer\n    Write-Host \"Removing 3D Objects from explorer 'My Computer' submenu\"\n    $Objects32 = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}\"\n    $Objects64 = \"HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}\"\n    If (Test-Path $Objects32) {\n        Remove-Item $Objects32 -Recurse \n    }\n    If (Test-Path $Objects64) {\n        Remove-Item $Objects64 -Recurse \n    }\n}\n\nFunction Restore3dObjects {\n    #Restores 3D Objects from the 'My Computer' submenu in explorer\n    Write-Host \"Restoring 3D Objects from explorer 'My Computer' submenu\"\n    $Objects32 = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}\"\n    $Objects64 = \"HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}\"\n    If (!(Test-Path $Objects32)) {\n        New-Item $Objects32\n    }\n    If (!(Test-Path $Objects64)) {\n        New-Item $Objects64\n    }\n}\n\n#Function DisableLastUsedFilesAndFolders {\n#\tWrite-Host = \"Disable Explorer to show last used files and folders.\"\n#\tInvoke-Item (start powershell ((Split-Path $MyInvocation.InvocationName) + \"\\Individual Scripts\\Disable Last Used Files and Folders View.ps1\"))\n#}\n\n#Interactive prompt Debloat/Revert options\n$Button = [Windows.MessageBoxButton]::YesNoCancel\n$ErrorIco = [Windows.MessageBoxImage]::Error\n$Warn = [Windows.MessageBoxImage]::Warning\n$Ask = 'The following will allow you to either Debloat Windows 10 or to revert changes made after Debloating Windows 10.\n\n        Select \"Yes\" to Debloat Windows 10\n\n        Select \"No\" to Revert changes made by this script\n        \n        Select \"Cancel\" to stop the script.'\n\n$EverythingorSpecific = \"Would you like to remove everything that was preinstalled on your Windows Machine? Select Yes to remove everything, or select No to remove apps via a blacklist.\"\n$EdgePdf = \"Do you want to stop edge from taking over as the default PDF viewer?\"\n$EdgePdf2 = \"Do you want to revert changes that disabled Edge as the default PDF viewer?\"\n$Reboot = \"For some of the changes to properly take effect it is recommended to reboot your machine. Would you like to restart?\"\n$OneDriveDelete = \"Do you want to uninstall One Drive?\"\n$Unpin = \"Do you want to unpin all items from the Start menu?\"\n$InstallNET = \"Do you want to install .NET 3.5?\"\n$LastUsedFilesFolders = \"Do you want to hide last used files and folders in Explorer?\"\n$LastUsedFilesFolders2 = \"Do you want to show last used files and folders in Explorer?\"\n$ClearLastUsedFilesFolders = \"Do you want to clear last used files and folders?\"\n$AeroShake = \"Do you want to disable AeroShake?\"\n$AeroShake2 = \"Do you want to re-enable AeroShake?\"\n$Prompt1 = [Windows.MessageBox]::Show($Ask, \"Debloat or Revert\", $Button, $ErrorIco) \nSwitch ($Prompt1) {\n    #This will debloat Windows 10\n    Yes {\n        #Everything is specific prompt\n        $Prompt2 = [Windows.MessageBox]::Show($EverythingorSpecific, \"Everything or Specific\", $Button, $Warn)\n        switch ($Prompt2) {\n            Yes { \n                #Creates a \"drive\" to access the HKCR (HKEY_CLASSES_ROOT)\n                Write-Host \"Creating PSDrive 'HKCR' (HKEY_CLASSES_ROOT). This will be used for the duration of the script as it is necessary for the removal and modification of specific registry keys.\"\n                New-PSDrive  HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT\n                Start-Sleep 1\n                Write-Host \"Uninstalling bloatware, please wait.\"\n                DebloatAll\n                Write-Host \"Bloatware removed.\"\n                Start-Sleep 1\n                Write-Host \"Removing specific registry keys.\"\n                Remove-Keys\n                Write-Host \"Leftover bloatware registry keys removed.\"\n                Start-Sleep 1\n                Write-Host \"Checking to see if any Whitelisted Apps were removed, and if so re-adding them.\"\n                Start-Sleep 1\n                FixWhitelistedApps\n                Start-Sleep 1\n                Write-Host \"Disabling Cortana from search, disabling feedback to Microsoft, and disabling scheduled tasks that are considered to be telemetry or unnecessary.\"\n                Protect-Privacy\n                Start-Sleep 1\n                DisableCortana\n                Write-Host \"Cortana disabled and removed from search, feedback to Microsoft has been disabled, and scheduled tasks are disabled.\"\n                Start-Sleep 1\n                Write-Host \"Stopping and disabling Diagnostics Tracking Service\"\n                DisableDiagTrack\n                Write-Host \"Diagnostics Tracking Service disabled\"\n                Start-Sleep 1\n                Write-Host \"Disabling WAP push service\"\n                DisableWAPPush\n                Start-Sleep 1\n                Write-Host \"Re-enabling DMWAppushservice if it was disabled\"\n                CheckDMWService\n                Start-Sleep 1\n                Write-Host \"Removing 3D Objects from the 'My Computer' submenu in explorer\"\n                Remove3dObjects\n                Start-Sleep 1\n            }\n            No {\n                #Creates a \"drive\" to access the HKCR (HKEY_CLASSES_ROOT)\n                Write-Host \"Creating PSDrive 'HKCR' (HKEY_CLASSES_ROOT). This will be used for the duration of the script as it is necessary for the removal and modification of specific registry keys.\"\n                New-PSDrive  HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT\n                Start-Sleep 1\n                Write-Host \"Uninstalling bloatware, please wait.\"\n                DebloatBlacklist\n                Write-Host \"Bloatware removed.\"\n                Start-Sleep 1\n                Write-Host \"Removing specific registry keys.\"\n                Remove-Keys\n                Write-Host \"Leftover bloatware registry keys removed.\"\n                Start-Sleep 1\n                Write-Host \"Checking to see if any Whitelisted Apps were removed, and if so re-adding them.\"\n                Start-Sleep 1\n                FixWhitelistedApps\n                Start-Sleep 1\n                Write-Host \"Disabling Cortana from search, disabling feedback to Microsoft, and disabling scheduled tasks that are considered to be telemetry or unnecessary.\"\n                Protect-Privacy\n                Start-Sleep 1\n                DisableCortana\n                Write-Host \"Cortana disabled and removed from search, feedback to Microsoft has been disabled, and scheduled tasks are disabled.\"\n                Start-Sleep 1\n                Write-Host \"Stopping and disabling Diagnostics Tracking Service\"\n                DisableDiagTrack\n                Write-Host \"Diagnostics Tracking Service disabled\"\n                Start-Sleep 1\n                Write-Host \"Disabling WAP push service\"\n                Start-Sleep 1\n                DisableWAPPush\n                Write-Host \"Re-enabling DMWAppushservice if it was disabled\"\n                CheckDMWService\n                Start-Sleep 1\n            }\n        }\n        #Disabling EdgePDF prompt\n        $Prompt3 = [Windows.MessageBox]::Show($EdgePdf, \"Edge PDF\", $Button, $Warn)\n        Switch ($Prompt3) {\n            Yes {\n                Stop-EdgePDF\n                Write-Host \"Edge will no longer take over as the default PDF viewer.\"\n            }\n            No {\n                Write-Host \"You chose not to stop Edge from taking over as the default PDF viewer.\"\n            }\n        }\n        #Prompt asking to delete OneDrive\n        $Prompt4 = [Windows.MessageBox]::Show($OneDriveDelete, \"Delete OneDrive\", $Button, $ErrorIco) \n        Switch ($Prompt4) {\n            Yes {\n                UninstallOneDrive\n                Write-Host \"OneDrive is now removed from the computer.\"\n            }\n            No {\n                Write-Host \"You have chosen to skip removing OneDrive from your machine.\"\n            }\n        }\n        #Prompt asking if you'd like to unpin all start items\n        $Prompt5 = [Windows.MessageBox]::Show($Unpin, \"Unpin\", $Button, $ErrorIco) \n        Switch ($Prompt5) {\n            Yes {\n                UnpinStart\n                Write-Host \"Start Apps unpined.\"\n            }\n            No {\n                Write-Host \"Apps will remain pinned to the start menu.\"\n\n            }\n        }\n        #Prompt asking if you want to install .NET\n        $Prompt6 = [Windows.MessageBox]::Show($InstallNET, \"Install .Net\", $Button, $Warn)\n        Switch ($Prompt6) {\n            Yes {\n                Write-Host \"Initializing the installation of .NET 3.5...\"\n                DISM /Online /Enable-Feature /FeatureName:NetFx3 /All\n                Write-Host \".NET 3.5 has been successfully installed!\"\n            }\n            No {\n                Write-Host \"Skipping .NET install.\"\n            }\n        }\n#\t\t#Prompt asking if you want to deactivate Last Used Files and Folders\n#        $Prompt7 = [Windows.MessageBox]::Show($LastUsedFilesFolders, \"Deactivate Last Used Files and Folders\", $Button, $Warn)\n#        Switch ($Prompt7) {\n#            Yes {\n#                DisableLastUsedFilesAndFolders\n#                Write-Host \"Last Used Files and Folders will no longer been shown!\"\n#            }\n#            No {\n#                Write-Host \"Skipping Hiding Last used Files and Folders.\"\n#            }\n#        }\n\t\t\n        #Prompt asking if you'd like to reboot your machine\n        $Prompt0 = [Windows.MessageBox]::Show($Reboot, \"Reboot\", $Button, $Warn)\n        Switch ($Prompt0) {\n            Yes {\n                Write-Host \"Unloading the HKCR drive...\"\n                Remove-PSDrive HKCR \n                Start-Sleep 1\n                Write-Host \"Initiating reboot.\"\n                Stop-Transcript\n                Start-Sleep 2\n                Restart-Computer\n            }\n            No {\n                Write-Host \"Unloading the HKCR drive...\"\n                Remove-PSDrive HKCR \n                Start-Sleep 1\n                Write-Host \"Script has finished. Exiting.\"\n                Stop-Transcript\n                Start-Sleep 2\n                Exit\n            }\n        }\n    }\n    No {\n        Write-Host \"Reverting changes...\"\n        Write-Host \"Creating PSDrive 'HKCR' (HKEY_CLASSES_ROOT). This will be used for the duration of the script as it is necessary for the modification of specific registry keys.\"\n        New-PSDrive  HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT\n        Revert-Changes\n        #Prompt asking to revert edge changes as well\n        $Prompt6 = [Windows.MessageBox]::Show($EdgePdf2, \"Revert Edge\", $Button, $ErrorIco)\n        Switch ($Prompt6) {\n            Yes {\n                Enable-EdgePDF\n                Write-Host \"Edge will no longer be disabled from being used as the default Edge PDF viewer.\"\n            }\n            No {\n                Write-Host \"You have chosen to keep the setting that disallows Edge to be the default PDF viewer.\"\n            }\n        }\n        #Prompt asking if you'd like to reboot your machine\n        $Prompt0 = [Windows.MessageBox]::Show($Reboot, \"Reboot\", $Button, $Warn)\n        Switch ($Prompt0) {\n            Yes {\n                Write-Host \"Unloading the HKCR drive...\"\n                Remove-PSDrive HKCR \n                Start-Sleep 1\n                Write-Host \"Initiating reboot.\"\n                Stop-Transcript\n                Start-Sleep 2\n                Restart-Computer\n            }\n            No {\n                Write-Host \"Unloading the HKCR drive...\"\n                Remove-PSDrive HKCR \n                Start-Sleep 1\n                Write-Host \"Script has finished. Exiting.\"\n                Stop-Transcript\n                Start-Sleep 2\n                Exit\n            }\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "Windows10DebloaterGUI.ps1",
    "content": "<#\n$EnableEdgePDFTakeover.Text = \"Enable Edge PDF Takeover\"\n$EnableEdgePDFTakeover.Width = 185\n$EnableEdgePDFTakeover.Height = 35\n$EnableEdgePDFTakeover.Location = New-Object System.Drawing.Point(155, 260)\n\n#>\n\n#This will self elevate the script so with a UAC prompt since this script needs to be run as an Administrator in order to function properly.\n\n$ErrorActionPreference = 'SilentlyContinue'\n\n$Button = [System.Windows.MessageBoxButton]::YesNoCancel\n$ErrorIco = [System.Windows.MessageBoxImage]::Error\n$Ask = 'Do you want to run this as an Administrator?\n\n        Select \"Yes\" to Run as an Administrator\n\n        Select \"No\" to not run this as an Administrator\n        \n        Select \"Cancel\" to stop the script.'\n\nIf (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]'Administrator')) {\n    $Prompt = [System.Windows.MessageBox]::Show($Ask, \"Run as an Administrator or not?\", $Button, $ErrorIco) \n    Switch ($Prompt) {\n        #This will debloat Windows 10\n        Yes {\n            Write-Host \"You didn't run this script as an Administrator. This script will self elevate to run as an Administrator and continue.\"\n            Start-Process PowerShell.exe -ArgumentList (\"-NoProfile -ExecutionPolicy Bypass -File `\"{0}`\"\" -f $PSCommandPath) -Verb RunAs\n            Exit\n        }\n        No {\n            Break\n        }\n    }\n}\n\n\n#Unnecessary Windows 10 AppX apps that will be removed by the blacklist.\n$global:Bloatware = @(\n    \"Microsoft.PPIProjection\"\n    \"Microsoft.BingNews\"\n    \"Microsoft.GetHelp\"\n    \"Microsoft.Getstarted\"\n    \"Microsoft.Messaging\"\n    \"Microsoft.Microsoft3DViewer\"\n    \"Microsoft.MicrosoftOfficeHub\"\n    \"Microsoft.MicrosoftSolitaireCollection\"\n    \"Microsoft.NetworkSpeedTest\"\n    \"Microsoft.News\"                                    # Issue 77\n    \"Microsoft.Office.Lens\"                             # Issue 77\n    \"Microsoft.Office.OneNote\"\n    \"Microsoft.Office.Sway\"\n    \"Microsoft.OneConnect\"\n    \"Microsoft.People\"\n    \"Microsoft.Print3D\"\n    \"Microsoft.RemoteDesktop\"                           # Issue 120\n    \"Microsoft.SkypeApp\"\n    \"Microsoft.StorePurchaseApp\"\n    \"Microsoft.Office.Todo.List\"                        # Issue 77\n    \"Microsoft.Whiteboard\"                              # Issue 77\n    \"Microsoft.WindowsAlarms\"\n    \"microsoft.windowscommunicationsapps\"\n    \"Microsoft.WindowsFeedbackHub\"\n    \"Microsoft.WindowsMaps\"\n    \"Microsoft.WindowsSoundRecorder\"\n    \"Microsoft.Xbox.TCUI\"\n    \"Microsoft.XboxApp\"\n    \"Microsoft.XboxGameOverlay\"\n    \"Microsoft.XboxGamingOverlay\"\n    \"Microsoft.XboxIdentityProvider\"\n    \"Microsoft.XboxSpeechToTextOverlay\"\n    \"Microsoft.ZuneMusic\"\n    \"Microsoft.ZuneVideo\"\n\n    #Sponsored Windows 10 AppX Apps\n    #Add sponsored/featured apps to remove in the \"*AppName*\" format\n    \"EclipseManager\"\n    \"ActiproSoftwareLLC\"\n    \"AdobeSystemsIncorporated.AdobePhotoshopExpress\"\n    \"Duolingo-LearnLanguagesforFree\"\n    \"PandoraMediaInc\"\n    \"CandyCrush\"\n    \"BubbleWitch3Saga\"\n    \"Wunderlist\"\n    \"Flipboard\"\n    \"Twitter\"\n    \"Facebook\"\n    \"Spotify\"                                           # Issue 123\n    \"Minecraft\"\n    \"Royal Revolt\"\n    \"Sway\"                                              # Issue 77\n    \"Dolby\"                                             # Issue 78\n\n    #Optional: Typically not removed but you can if you need to for some reason\n    #\"Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe\"\n    #\"Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe\"\n    #\"Microsoft.BingWeather\"\n)\n\n#Valuable Windows 10 AppX apps that most people want to keep. Protected from DeBloat All.\n#Credit to /u/GavinEke for a modified version of my whitelist code\n$global:WhiteListedApps = @(\n    \"Microsoft.WindowsCalculator\"               # Microsoft removed legacy calculator\n    \"Microsoft.WindowsStore\"                    # Issue 1\n    \"Microsoft.Windows.Photos\"                  # Microsoft disabled/hid legacy photo viewer\n    \"CanonicalGroupLimited.UbuntuonWindows\"     # Issue 10\n    \"Microsoft.Xbox.TCUI\"                       # Issue 25, 91  Many home users want to play games\n    \"Microsoft.XboxApp\"\n    \"Microsoft.XboxGameOverlay\"\n    \"Microsoft.XboxGamingOverlay\"               # Issue 25, 91  Many home users want to play games\n    \"Microsoft.XboxIdentityProvider\"            # Issue 25, 91  Many home users want to play games\n    \"Microsoft.XboxSpeechToTextOverlay\"\n    \"Microsoft.MicrosoftStickyNotes\"            # Issue 33  New functionality.\n    \"Microsoft.MSPaint\"                         # Issue 32  This is Paint3D, legacy paint still exists in Windows 10\n    \"Microsoft.WindowsCamera\"                   # Issue 65  New functionality.\n    \"\\.NET\"\n    \"Microsoft.HEIFImageExtension\"              # Issue 68\n    \"Microsoft.ScreenSketch\"                    # Issue 55: Looks like Microsoft will be axing snipping tool and using Snip & Sketch going forward\n    \"Microsoft.StorePurchaseApp\"                # Issue 68\n    \"Microsoft.VP9VideoExtensions\"              # Issue 68\n    \"Microsoft.WebMediaExtensions\"              # Issue 68\n    \"Microsoft.WebpImageExtension\"              # Issue 68\n    \"Microsoft.DesktopAppInstaller\"             # Issue 68\n    \"WindSynthBerry\"                            # Issue 68\n    \"MIDIBerry\"                                 # Issue 68\n    \"Slack\"                                     # Issue 83\n    \"*Nvidia*\"                                  # Issue 198\n    \"Microsoft.MixedReality.Portal\"             # Issue 195\n)\n\n#NonRemovable Apps that where getting attempted and the system would reject the uninstall, speeds up debloat and prevents 'initalizing' overlay when removing apps\n$NonRemovables = Get-AppxPackage -AllUsers | Where-Object { $_.NonRemovable -eq $true } | ForEach { $_.Name }\n$NonRemovables += Get-AppxPackage | Where-Object { $_.NonRemovable -eq $true } | ForEach { $_.Name }\n$NonRemovables += Get-AppxProvisionedPackage -Online | Where-Object { $_.NonRemovable -eq $true } | ForEach { $_.DisplayName }\n$NonRemovables = $NonRemovables | Sort-Object -Unique\n\nif ($NonRemovables -eq $null ) {\n    # the .NonRemovable property doesn't exist until version 18xx. Use a hard-coded list instead.\n    #WARNING: only use exact names here - no short names or wildcards\n    $NonRemovables = @(\n        \"1527c705-839a-4832-9118-54d4Bd6a0c89\"\n        \"c5e2524a-ea46-4f67-841f-6a9465d9d515\"\n        \"E2A4F912-2574-4A75-9BB0-0D023378592B\"\n        \"F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE\"\n        \"InputApp\"\n        \"Microsoft.AAD.BrokerPlugin\"\n        \"Microsoft.AccountsControl\"\n        \"Microsoft.BioEnrollment\"\n        \"Microsoft.CredDialogHost\"\n        \"Microsoft.ECApp\"\n        \"Microsoft.LockApp\"\n        \"Microsoft.MicrosoftEdgeDevToolsClient\"\n        \"Microsoft.MicrosoftEdge\"\n        \"Microsoft.PPIProjection\"\n        \"Microsoft.Win32WebViewHost\"\n        \"Microsoft.Windows.Apprep.ChxApp\"\n        \"Microsoft.Windows.AssignedAccessLockApp\"\n        \"Microsoft.Windows.CapturePicker\"\n        \"Microsoft.Windows.CloudExperienceHost\"\n        \"Microsoft.Windows.ContentDeliveryManager\"\n        \"Microsoft.Windows.Cortana\"\n        \"Microsoft.Windows.HolographicFirstRun\"         # Added 1709\n        \"Microsoft.Windows.NarratorQuickStart\"\n        \"Microsoft.Windows.OOBENetworkCaptivePortal\"    # Added 1709\n        \"Microsoft.Windows.OOBENetworkConnectionFlow\"   # Added 1709\n        \"Microsoft.Windows.ParentalControls\"\n        \"Microsoft.Windows.PeopleExperienceHost\"\n        \"Microsoft.Windows.PinningConfirmationDialog\"\n        \"Microsoft.Windows.SecHealthUI\"                 # Issue 117 Windows Defender\n        \"Microsoft.Windows.SecondaryTileExperience\"     # Added 1709\n        \"Microsoft.Windows.SecureAssessmentBrowser\"\n        \"Microsoft.Windows.ShellExperienceHost\"\n        \"Microsoft.Windows.XGpuEjectDialog\"\n        \"Microsoft.XboxGameCallableUI\"                  # Issue 91\n        \"Windows.CBSPreview\"\n        \"windows.immersivecontrolpanel\"\n        \"Windows.PrintDialog\"\n        \"Microsoft.VCLibs.140.00\"\n        \"Microsoft.Services.Store.Engagement\"\n        \"Microsoft.UI.Xaml.2.0\"\n    )\n}\n\n# import library code - located relative to this script\nFunction dotInclude() {\n    Param(\n        [Parameter(Mandatory)]\n        [string]$includeFile\n    )\n    # Look for the file in the same directory as this script\n    $scriptPath = $PSScriptRoot\n    if ( $PSScriptRoot -eq $null -and $psISE) {\n        $scriptPath = (Split-Path -Path $psISE.CurrentFile.FullPath)\n    }\n    if ( test-path $scriptPath\\$includeFile ) {\n        # import and immediately execute the requested file\n        .$scriptPath\\$includeFile\n    }\n}\n\n# Override built-in blacklist/whitelist with user defined lists\ndotInclude 'custom-lists.ps1'\n\n#convert to regular expression to allow for the super-useful -match operator\n$global:BloatwareRegex = $global:Bloatware -join '|'\n$global:WhiteListedAppsRegex = $global:WhiteListedApps -join '|'\n\n\n# This form was created using POSHGUI.com  a free online gui designer for PowerShell\nAdd-Type -AssemblyName System.Windows.Forms\n[System.Windows.Forms.Application]::EnableVisualStyles()\n\n$Form                            = New-Object system.Windows.Forms.Form\n$Form.ClientSize                 = New-Object System.Drawing.Point(500,570)\n$Form.StartPosition              = 'CenterScreen'\n$Form.FormBorderStyle            = 'FixedSingle'\n$Form.MinimizeBox                = $false\n$Form.MaximizeBox                = $false\n$Form.ShowIcon                   = $false\n$Form.text                       = \"Windows10Debloater\"\n$Form.TopMost                    = $false\n$Form.BackColor                  = [System.Drawing.ColorTranslator]::FromHtml(\"#252525\")\n\n$DebloatPanel                    = New-Object system.Windows.Forms.Panel\n$DebloatPanel.height             = 160\n$DebloatPanel.width              = 480\n$DebloatPanel.Anchor             = 'top,right,left'\n$DebloatPanel.location           = New-Object System.Drawing.Point(10,10)\n\n$RegistryPanel                   = New-Object system.Windows.Forms.Panel\n$RegistryPanel.height            = 80\n$RegistryPanel.width             = 480\n$RegistryPanel.Anchor            = 'top,right,left'\n$RegistryPanel.location          = New-Object System.Drawing.Point(10,180)\n\n$CortanaPanel                    = New-Object system.Windows.Forms.Panel\n$CortanaPanel.height             = 120\n$CortanaPanel.width              = 153\n$CortanaPanel.Anchor             = 'top,right,left'\n$CortanaPanel.location           = New-Object System.Drawing.Point(10,270)\n\n$EdgePanel                       = New-Object system.Windows.Forms.Panel\n$EdgePanel.height                = 120\n$EdgePanel.width                 = 154\n$EdgePanel.Anchor                = 'top,right,left'\n$EdgePanel.location              = New-Object System.Drawing.Point(173,270)\n\n$DarkThemePanel                  = New-Object system.Windows.Forms.Panel\n$DarkThemePanel.height           = 120\n$DarkThemePanel.width            = 153\n$DarkThemePanel.Anchor           = 'top,right,left'\n$DarkThemePanel.location         = New-Object System.Drawing.Point(337,270)\n\n$OtherPanel                      = New-Object system.Windows.Forms.Panel\n$OtherPanel.height               = 160\n$OtherPanel.width                = 480\n$OtherPanel.Anchor               = 'top,right,left'\n$OtherPanel.location             = New-Object System.Drawing.Point(10,400)\n\n$Debloat                         = New-Object system.Windows.Forms.Label\n$Debloat.text                    = \"DEBLOAT OPTIONS\"\n$Debloat.AutoSize                = $true\n$Debloat.width                   = 457\n$Debloat.height                  = 142\n$Debloat.Anchor                  = 'top,right,left'\n$Debloat.location                = New-Object System.Drawing.Point(10,9)\n$Debloat.Font                    = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))\n$Debloat.ForeColor               = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$CustomizeBlacklist             = New-Object system.Windows.Forms.Button\n$CustomizeBlacklist.FlatStyle   = 'Flat'\n$CustomizeBlacklist.text        = \"CUSTOMISE BLOCKLIST\"\n$CustomizeBlacklist.width       = 460\n$CustomizeBlacklist.height      = 30\n$CustomizeBlacklist.Anchor      = 'top,right,left'\n$CustomizeBlacklist.location    = New-Object System.Drawing.Point(10,40)\n$CustomizeBlacklist.Font        = New-Object System.Drawing.Font('Consolas',9)\n$CustomizeBlacklist.ForeColor   = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$RemoveAllBloatware              = New-Object system.Windows.Forms.Button\n$RemoveAllBloatware.FlatStyle    = 'Flat'\n$RemoveAllBloatware.text         = \"REMOVE ALL BLOATWARE\"\n$RemoveAllBloatware.width        = 460\n$RemoveAllBloatware.height       = 30\n$RemoveAllBloatware.Anchor       = 'top,right,left'\n$RemoveAllBloatware.location     = New-Object System.Drawing.Point(10,80)\n$RemoveAllBloatware.Font         = New-Object System.Drawing.Font('Consolas',9)\n$RemoveAllBloatware.ForeColor    = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$RemoveBlacklistedBloatware                 = New-Object system.Windows.Forms.Button\n$RemoveBlacklistedBloatware.FlatStyle       = 'Flat'\n$RemoveBlacklistedBloatware.text            = \"REMOVE BLOATWARE WITH CUSTOM BLOCKLIST\"\n$RemoveBlacklistedBloatware.width           = 460\n$RemoveBlacklistedBloatware.height          = 30\n$RemoveBlacklistedBloatware.Anchor          = 'top,right,left'\n$RemoveBlacklistedBloatware.location        = New-Object System.Drawing.Point(10,120)\n$RemoveBlacklistedBloatware.Font            = New-Object System.Drawing.Font('Consolas',9)\n$RemoveBlacklistedBloatware.ForeColor       = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$Registry                        = New-Object system.Windows.Forms.Label\n$Registry.text                   = \"REGISTRY CHANGES\"\n$Registry.AutoSize               = $true\n$Registry.width                  = 457\n$Registry.height                 = 142\n$Registry.Anchor                 = 'top,right,left'\n$Registry.location               = New-Object System.Drawing.Point(10,10)\n$Registry.Font                   = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))\n$Registry.ForeColor              = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$RevertChanges                    = New-Object system.Windows.Forms.Button\n$RevertChanges.FlatStyle          = 'Flat'\n$RevertChanges.text               = \"REVERT REGISTRY CHANGES\"\n$RevertChanges.width              = 460\n$RevertChanges.height             = 30\n$RevertChanges.Anchor             = 'top,right,left'\n$RevertChanges.location           = New-Object System.Drawing.Point(10,40)\n$RevertChanges.Font               = New-Object System.Drawing.Font('Consolas',9)\n$RevertChanges.ForeColor          = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$Cortana                         = New-Object system.Windows.Forms.Label\n$Cortana.text                    = \"CORTANA\"\n$Cortana.AutoSize                = $true\n$Cortana.width                   = 457\n$Cortana.height                  = 142\n$Cortana.Anchor                  = 'top,right,left'\n$Cortana.location                = New-Object System.Drawing.Point(10,10)\n$Cortana.Font                    = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))\n$Cortana.ForeColor               = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$EnableCortana                   = New-Object system.Windows.Forms.Button\n$EnableCortana.FlatStyle         = 'Flat'\n$EnableCortana.text              = \"ENABLE\"\n$EnableCortana.width             = 133\n$EnableCortana.height            = 30\n$EnableCortana.Anchor            = 'top,right,left'\n$EnableCortana.location          = New-Object System.Drawing.Point(10,40)\n$EnableCortana.Font              = New-Object System.Drawing.Font('Consolas',9)\n$EnableCortana.ForeColor         = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$DisableCortana                  = New-Object system.Windows.Forms.Button\n$DisableCortana.FlatStyle        = 'Flat'\n$DisableCortana.text             = \"DISABLE\"\n$DisableCortana.width            = 133\n$DisableCortana.height           = 30\n$DisableCortana.Anchor           = 'top,right,left'\n$DisableCortana.location         = New-Object System.Drawing.Point(10,80)\n$DisableCortana.Font             = New-Object System.Drawing.Font('Consolas',9)\n$DisableCortana.ForeColor        = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$Edge                            = New-Object system.Windows.Forms.Label\n$Edge.text                       = \"EDGE PDF\"\n$Edge.AutoSize                   = $true\n$Edge.width                      = 457\n$Edge.height                     = 142\n$Edge.Anchor                     = 'top,right,left'\n$Edge.location                   = New-Object System.Drawing.Point(10,10)\n$Edge.Font                       = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))\n$Edge.ForeColor                  = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$EnableEdgePDFTakeover           = New-Object system.Windows.Forms.Button\n$EnableEdgePDFTakeover.FlatStyle = 'Flat'\n$EnableEdgePDFTakeover.text      = \"ENABLE\"\n$EnableEdgePDFTakeover.width     = 134\n$EnableEdgePDFTakeover.height    = 30\n$EnableEdgePDFTakeover.Anchor    = 'top,right,left'\n$EnableEdgePDFTakeover.location  = New-Object System.Drawing.Point(10,40)\n$EnableEdgePDFTakeover.Font      = New-Object System.Drawing.Font('Consolas',9)\n$EnableEdgePDFTakeover.ForeColor  = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$DisableEdgePDFTakeover             = New-Object system.Windows.Forms.Button\n$DisableEdgePDFTakeover.FlatStyle   = 'Flat'\n$DisableEdgePDFTakeover.text        = \"DISABLE\"\n$DisableEdgePDFTakeover.width       = 134\n$DisableEdgePDFTakeover.height      = 30\n$DisableEdgePDFTakeover.Anchor      = 'top,right,left'\n$DisableEdgePDFTakeover.location    = New-Object System.Drawing.Point(10,80)\n$DisableEdgePDFTakeover.Font        = New-Object System.Drawing.Font('Consolas',9)\n$DisableEdgePDFTakeover.ForeColor   = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$Theme                           = New-Object system.Windows.Forms.Label\n$Theme.text                      = \"DARK THEME\"\n$Theme.AutoSize                  = $true\n$Theme.width                     = 457\n$Theme.height                    = 142\n$Theme.Anchor                    = 'top,right,left'\n$Theme.location                  = New-Object System.Drawing.Point(10,10)\n$Theme.Font                      = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))\n$Theme.ForeColor                 = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$EnableDarkMode                  = New-Object system.Windows.Forms.Button\n$EnableDarkMode.FlatStyle        = 'Flat'\n$EnableDarkMode.text             = \"ENABLE\"\n$EnableDarkMode.width            = 133\n$EnableDarkMode.height           = 30\n$EnableDarkMode.Anchor           = 'top,right,left'\n$EnableDarkMode.location         = New-Object System.Drawing.Point(10,40)\n$EnableDarkMode.Font             = New-Object System.Drawing.Font('Consolas',9)\n$EnableDarkMode.ForeColor        = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$DisableDarkMode                 = New-Object system.Windows.Forms.Button\n$DisableDarkMode.FlatStyle       = 'Flat'\n$DisableDarkMode.text            = \"DISABLE\"\n$DisableDarkMode.width           = 133\n$DisableDarkMode.height          = 30\n$DisableDarkMode.Anchor          = 'top,right,left'\n$DisableDarkMode.location        = New-Object System.Drawing.Point(10,80)\n$DisableDarkMode.Font            = New-Object System.Drawing.Font('Consolas',9)\n$DisableDarkMode.ForeColor       = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$Other                           = New-Object system.Windows.Forms.Label\n$Other.text                      = \"OTHER CHANGES & FIXES\"\n$Other.AutoSize                  = $true\n$Other.width                     = 457\n$Other.height                    = 142\n$Other.Anchor                    = 'top,right,left'\n$Other.location                  = New-Object System.Drawing.Point(10,10)\n$Other.Font                      = New-Object System.Drawing.Font('Consolas',15,[System.Drawing.FontStyle]([System.Drawing.FontStyle]::Bold))\n$Other.ForeColor                 = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$RemoveOnedrive                  = New-Object system.Windows.Forms.Button\n$RemoveOnedrive.FlatStyle        = 'Flat'\n$RemoveOnedrive.text             = \"UNINSTALL ONEDRIVE\"\n$RemoveOnedrive.width            = 225\n$RemoveOnedrive.height           = 30\n$RemoveOnedrive.Anchor           = 'top,right,left'\n$RemoveOnedrive.location         = New-Object System.Drawing.Point(10,40)\n$RemoveOnedrive.Font             = New-Object System.Drawing.Font('Consolas',9)\n$RemoveOnedrive.ForeColor        = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$UnpinStartMenuTiles             = New-Object system.Windows.Forms.Button\n$UnpinStartMenuTiles.FlatStyle   = 'Flat'\n$UnpinStartMenuTiles.text        = \"UNPIN TILES FROM START MENU\"\n$UnpinStartMenuTiles.width       = 225\n$UnpinStartMenuTiles.height      = 30\n$UnpinStartMenuTiles.Anchor      = 'top,right,left'\n$UnpinStartMenuTiles.location    = New-Object System.Drawing.Point(245,40)\n$UnpinStartMenuTiles.Font        = New-Object System.Drawing.Font('Consolas',9)\n$UnpinStartMenuTiles.ForeColor   = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$DisableTelemetry                = New-Object system.Windows.Forms.Button\n$DisableTelemetry.FlatStyle      = 'Flat'\n$DisableTelemetry.text           = \"DISABLE TELEMETRY / TASKS\"\n$DisableTelemetry.width          = 225\n$DisableTelemetry.height         = 30\n$DisableTelemetry.Anchor         = 'top,right,left'\n$DisableTelemetry.location       = New-Object System.Drawing.Point(10,80)\n$DisableTelemetry.Font           = New-Object System.Drawing.Font('Consolas',9)\n$DisableTelemetry.ForeColor      = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$RemoveRegkeys                   = New-Object system.Windows.Forms.Button\n$RemoveRegkeys.FlatStyle         = 'Flat'\n$RemoveRegkeys.text              = \"REMOVE BLOATWARE REGKEYS\"\n$RemoveRegkeys.width             = 225\n$RemoveRegkeys.height            = 30\n$RemoveRegkeys.Anchor            = 'top,right,left'\n$RemoveRegkeys.location          = New-Object System.Drawing.Point(245,80)\n$RemoveRegkeys.Font              = New-Object System.Drawing.Font('Consolas',9)\n$RemoveRegkeys.ForeColor         = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$InstallNet35                    = New-Object system.Windows.Forms.Button\n$InstallNet35.FlatStyle          = 'Flat'\n$InstallNet35.text               = \"INSTALL .NET V3.5\"\n$InstallNet35.width              = 460\n$InstallNet35.height             = 30\n$InstallNet35.Anchor             = 'top,right,left'\n$InstallNet35.location           = New-Object System.Drawing.Point(10,120)\n$InstallNet35.Font               = New-Object System.Drawing.Font('Consolas',9)\n$InstallNet35.ForeColor          = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n$Form.controls.AddRange(@($RegistryPanel,$DebloatPanel,$CortanaPanel,$EdgePanel,$DarkThemePanel,$OtherPanel))\n$DebloatPanel.controls.AddRange(@($Debloat,$CustomizeBlacklist,$RemoveAllBloatware,$RemoveBlacklistedBloatware))\n$RegistryPanel.controls.AddRange(@($Registry,$RevertChanges))\n$CortanaPanel.controls.AddRange(@($Cortana,$EnableCortana,$DisableCortana))\n$EdgePanel.controls.AddRange(@($EnableEdgePDFTakeover,$DisableEdgePDFTakeover,$Edge))\n$DarkThemePanel.controls.AddRange(@($Theme,$DisableDarkMode,$EnableDarkMode))\n$OtherPanel.controls.AddRange(@($Other,$RemoveOnedrive,$InstallNet35,$UnpinStartMenuTiles,$DisableTelemetry,$RemoveRegkeys))\n\n$DebloatFolder = \"C:\\Temp\\Windows10Debloater\"\nIf (Test-Path $DebloatFolder) {\n    Write-Host \"${DebloatFolder} exists. Skipping.\"\n}\nElse {\n    Write-Host \"The folder ${DebloatFolder} doesn't exist. This folder will be used for storing logs created after the script runs. Creating now.\"\n    Start-Sleep 1\n    New-Item -Path \"${DebloatFolder}\" -ItemType Directory\n    Write-Host \"The folder ${DebloatFolder} was successfully created.\"\n}\n\nStart-Transcript -OutputDirectory \"${DebloatFolder}\"\n\nWrite-Output \"Creating System Restore Point if one does not already exist. If one does, then you will receive a warning. Please wait...\"\nCheckpoint-Computer -Description \"Before using W10DebloaterGUI.ps1\" \n\n\n#region gui events {\n$CustomizeBlacklist.Add_Click( {\n        $CustomizeForm                  = New-Object System.Windows.Forms.Form\n        $CustomizeForm.ClientSize       = New-Object System.Drawing.Point(580,570)\n        $CustomizeForm.StartPosition    = 'CenterScreen'\n        $CustomizeForm.FormBorderStyle  = 'FixedSingle'\n        $CustomizeForm.MinimizeBox      = $false\n        $CustomizeForm.MaximizeBox      = $false\n        $CustomizeForm.ShowIcon         = $false\n        $CustomizeForm.Text             = \"Customize Allowlist and Blocklist\"\n        $CustomizeForm.TopMost          = $false\n        $CustomizeForm.AutoScroll       = $false\n        $CustomizeForm.BackColor        = [System.Drawing.ColorTranslator]::FromHtml(\"#252525\")\n\n        $ListPanel                     = New-Object system.Windows.Forms.Panel\n        $ListPanel.height              = 510\n        $ListPanel.width               = 572\n        $ListPanel.Anchor              = 'top,right,left'\n        $ListPanel.location            = New-Object System.Drawing.Point(10,10)\n        $ListPanel.AutoScroll          = $true\n        $ListPanel.BackColor           = [System.Drawing.ColorTranslator]::FromHtml(\"#252525\")\n\n\n        $SaveList                       = New-Object System.Windows.Forms.Button\n        $SaveList.FlatStyle             = 'Flat'\n        $SaveList.Text                  = \"Save custom Allowlist and Blocklist to custom-lists.ps1\"\n        $SaveList.width                 = 560\n        $SaveList.height                = 30\n        $SaveList.Location              = New-Object System.Drawing.Point(10, 530)\n        $SaveList.Font                  = New-Object System.Drawing.Font('Consolas',9)\n        $SaveList.ForeColor             = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n\n        $CustomizeForm.controls.AddRange(@($SaveList,$ListPanel))\n\n        $SaveList.Add_Click( {\n               # $ErrorActionPreference = 'SilentlyContinue'\n\n                '$global:WhiteListedApps = @(' | Out-File -FilePath $PSScriptRoot\\custom-lists.ps1 -Encoding utf8\n                @($ListPanel.controls) | ForEach {\n                    if ($_ -is [System.Windows.Forms.CheckBox] -and $_.Enabled -and !$_.Checked) {\n                        \"    \"\"$( $_.Text )\"\"\" | Out-File -FilePath $PSScriptRoot\\custom-lists.ps1 -Append -Encoding utf8\n                    }\n                }\n                ')' | Out-File -FilePath $PSScriptRoot\\custom-lists.ps1 -Append -Encoding utf8\n\n                '$global:Bloatware = @(' | Out-File -FilePath $PSScriptRoot\\custom-lists.ps1 -Append -Encoding utf8\n                @($ListPanel.controls) | ForEach {\n                    if ($_ -is [System.Windows.Forms.CheckBox] -and $_.Enabled -and $_.Checked) {\n                        \"    \"\"$($_.Text)\"\"\" | Out-File -FilePath $PSScriptRoot\\custom-lists.ps1 -Append -Encoding utf8\n                    }\n                }\n                ')' | Out-File -FilePath $PSScriptRoot\\custom-lists.ps1 -Append -Encoding utf8\n\n                #Over-ride the white/blacklist with the newly saved custom list\n                dotInclude custom-lists.ps1\n\n                #convert to regular expression to allow for the super-useful -match operator\n                $global:BloatwareRegex = $global:Bloatware -join '|'\n                $global:WhiteListedAppsRegex = $global:WhiteListedApps -join '|'\n            })\n\n        Function AddAppToCustomizeForm() {\n            Param(\n                [Parameter(Mandatory)]\n                [int] $position,\n                [Parameter(Mandatory)]\n                [string] $appName,\n                [Parameter(Mandatory)]\n                [bool] $enabled,\n                [Parameter(Mandatory)]\n                [bool] $checked,\n                [Parameter(Mandatory)]\n                [bool] $autocheck,\n\n                [string] $notes\n            )\n\n            $label = New-Object System.Windows.Forms.Label\n            $label.Location = New-Object System.Drawing.Point(-10, (2 + $position * 25))\n            $label.Text = $notes\n            $label.Font = New-Object System.Drawing.Font('Consolas',8)\n            $label.Width = 260\n            $label.Height = 27\n            $Label.TextAlign = [System.Drawing.ContentAlignment]::TopRight\n            $label.ForeColor = [System.Drawing.ColorTranslator]::FromHtml(\"#888888\")\n            $ListPanel.controls.AddRange(@($label))\n\n            $Checkbox = New-Object System.Windows.Forms.CheckBox\n            $Checkbox.Text = $appName\n            $CheckBox.Font = New-Object System.Drawing.Font('Consolas',8)\n            $CheckBox.FlatStyle = 'Flat'\n            $CheckBox.ForeColor = [System.Drawing.ColorTranslator]::FromHtml(\"#eeeeee\")\n            $Checkbox.Location = New-Object System.Drawing.Point(268, (0 + $position * 25))\n            $Checkbox.Autosize = 1;\n            $Checkbox.Checked = $checked\n            $Checkbox.Enabled = $enabled\n            $CheckBox.AutoCheck = $autocheck\n            $ListPanel.controls.AddRange(@($CheckBox))\n        }\n\n\n        $Installed = @( (Get-AppxPackage).Name )\n        $Online = @( (Get-AppxProvisionedPackage -Online).DisplayName )\n        $AllUsers = @( (Get-AppxPackage -AllUsers).Name )\n        [int]$checkboxCounter = 0\n\n        ForEach ($item in $NonRemovables) {\n            $string = \"\"\n            if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) { $string += \" ConflictBlacklist \" }\n            if ( $null -notmatch $global:WhiteListedAppsRegex -and $item -cmatch $global:WhiteListedAppsRegex ) { $string += \" ConflictWhitelist\" }\n            if ( $null -notmatch $Installed -and $Installed -cmatch $item) { $string += \"Installed\" }\n            if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { $string += \" AllUsers\" }\n            if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += \" Online\" }\n            $string += \"  Non-Removable\"\n            AddAppToCustomizeForm $checkboxCounter $item $true $false $false $string\n            ++$checkboxCounter\n        }\n        ForEach ( $item in $global:WhiteListedApps ) {\n            $string = \"\"\n            if ( $null -notmatch $NonRemovables -and $NonRemovables -cmatch $item ) { $string += \" Conflict NonRemovables \" }\n            if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) { $string += \" ConflictBlacklist \" }\n            if ( $null -notmatch $Installed -and $Installed -cmatch $item) { $string += \"Installed\" }\n            if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { $string += \" AllUsers\" }\n            if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += \" Online\" }\n            AddAppToCustomizeForm $checkboxCounter $item $true $false $true $string\n            ++$checkboxCounter\n        }\n        ForEach ( $item in $global:Bloatware ) {\n            $string = \"\"\n            if ( $null -notmatch $NonRemovables -and $NonRemovables -cmatch $item ) { $string += \" Conflict NonRemovables \" }\n            if ( $null -notmatch $global:WhiteListedAppsRegex -and $item -cmatch $global:WhiteListedAppsRegex ) { $string += \" Conflict Whitelist \" }\n            if ( $null -notmatch $Installed -and $Installed -cmatch $item) { $string += \"Installed\" }\n            if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { $string += \" AllUsers\" }\n            if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += \" Online\" }\n            AddAppToCustomizeForm $checkboxCounter $item $true $true $true $string\n            ++$checkboxCounter\n        }\n        ForEach ( $item in $AllUsers ) {\n            $string = \"NEW   AllUsers\"\n            if ( $null -notmatch $NonRemovables -and $NonRemovables -cmatch $item ) { continue }\n            if ( $null -notmatch $global:WhiteListedAppsRegex -and $item -cmatch $global:WhiteListedAppsRegex ) { continue }\n            if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) { continue }\n            if ( $null -notmatch $Installed -and $Installed -cmatch $item) { $string += \" Installed\" }\n            if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += \" Online\" }\n            AddAppToCustomizeForm $checkboxCounter $item $true $true $true $string\n            ++$checkboxCounter\n        }\n        ForEach ( $item in $Installed ) {\n            $string = \"NEW   Installed\"\n            if ( $null -notmatch $NonRemovables -and $NonRemovables -cmatch $item ) { continue }\n            if ( $null -notmatch $global:WhiteListedAppsRegex -and $item -cmatch $global:WhiteListedAppsRegex ) { continue }\n            if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) { continue }\n            if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { continue }\n            if ( $null -notmatch $Online -and $Online -cmatch $item) { $string += \" Online\" }\n            AddAppToCustomizeForm $checkboxCounter $item $true $true $true $string\n            ++$checkboxCounter\n        }\n        ForEach ( $item in $Online ) {\n            $string = \"NEW   Online \"\n            if ( $null -notmatch $NonRemovables -and $NonRemovables -cmatch $item ) { continue }\n            if ( $null -notmatch $global:WhiteListedAppsRegex -and $item -cmatch $global:WhiteListedAppsRegex ) { continue }\n            if ( $null -notmatch $global:BloatwareRegex -and $item -cmatch $global:BloatwareRegex ) { continue }\n            if ( $null -notmatch $Installed -and $Installed -cmatch $item) { continue }\n            if ( $null -notmatch $AllUsers -and $AllUsers -cmatch $item) { continue }\n            AddAppToCustomizeForm $checkboxCounter $item $true $true $true $string\n            ++$checkboxCounter\n        }\n        [void]$CustomizeForm.ShowDialog()\n    })\n\n\n$RemoveBlacklistedBloatware.Add_Click( { \n        $ErrorActionPreference = 'SilentlyContinue'\n        Function DebloatBlacklist {\n            Write-Host \"Requesting removal of $global:BloatwareRegex\"\n            Write-Host \"--- This may take a while - please be patient ---\"\n            Get-AppxPackage | Where-Object Name -cmatch $global:BloatwareRegex | Remove-AppxPackage\n            Write-Host \"...now starting the silent ProvisionedPackage bloatware removal...\"\n            Get-AppxProvisionedPackage -Online | Where-Object DisplayName -cmatch $global:BloatwareRegex | Remove-AppxProvisionedPackage -Online\n            Write-Host \"...and the final cleanup...\"\n            Get-AppxPackage -AllUsers | Where-Object Name -cmatch $global:BloatwareRegex | Remove-AppxPackage\n        }\n        Write-Host \"`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`n`nRemoving blocklisted Bloatware.`n\"\n        DebloatBlacklist\n        Write-Host \"Bloatware removed!\"\n    })\n$RemoveAllBloatware.Add_Click( { \n        $ErrorActionPreference = 'SilentlyContinue'\n        #This function finds any AppX/AppXProvisioned package and uninstalls it, except for Freshpaint, Windows Calculator, Windows Store, and Windows Photos.\n        #Also, to note - This does NOT remove essential system services/software/etc such as .NET framework installations, Cortana, Edge, etc.\n\n        #This is the switch parameter for running this script as a 'silent' script, for use in MDT images or any type of mass deployment without user interaction.\n\n        Function Begin-SysPrep {\n\n            Write-Host \"Starting Sysprep Fixes\"\n   \n            # Disable Windows Store Automatic Updates\n            Write-Host \"Adding Registry key to Disable Windows Store Automatic Updates\"\n            $registryPath = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\WindowsStore\"\n            If (!(Test-Path $registryPath)) {\n                Mkdir $registryPath\n                New-ItemProperty $registryPath AutoDownload -Value 2 \n            }\n            Set-ItemProperty $registryPath AutoDownload -Value 2\n\n            #Stop WindowsStore Installer Service and set to Disabled\n            Write-Host \"Stopping InstallService\"\n            Stop-Service InstallService\n            Write-Host \"Setting InstallService Startup to Disabled\"\n            Set-Service InstallService -StartupType Disabled\n        }\n        \n        Function CheckDMWService {\n\n            Param([switch]$Debloat)\n  \n            If (Get-Service dmwappushservice | Where-Object { $_.StartType -eq \"Disabled\" }) {\n                Set-Service dmwappushservice -StartupType Automatic\n            }\n\n            If (Get-Service dmwappushservice | Where-Object { $_.Status -eq \"Stopped\" }) {\n                Start-Service dmwappushservice\n            } \n        }\n\n        Function DebloatAll {\n            #Removes AppxPackages\n            Get-AppxPackage | Where { !($_.Name -cmatch $global:WhiteListedAppsRegex) -and !($NonRemovables -cmatch $_.Name) } | Remove-AppxPackage\n            Get-AppxProvisionedPackage -Online | Where { !($_.DisplayName -cmatch $global:WhiteListedAppsRegex) -and !($NonRemovables -cmatch $_.DisplayName) } | Remove-AppxProvisionedPackage -Online\n            Get-AppxPackage -AllUsers | Where { !($_.Name -cmatch $global:WhiteListedAppsRegex) -and !($NonRemovables -cmatch $_.Name) } | Remove-AppxPackage\n        }\n  \n        #Creates a PSDrive to be able to access the 'HKCR' tree\n        New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT\n  \n        Function Remove-Keys {         \n            #These are the registry keys that it will delete.\n          \n            $Keys = @(\n          \n                #Remove Background Tasks\n                \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y\"\n                \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n                \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe\"\n                \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy\"\n                \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy\"\n                \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy\"\n          \n                #Windows File\n                \"HKCR:\\Extensions\\ContractId\\Windows.File\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n          \n                #Registry keys to delete if they aren't uninstalled by RemoveAppXPackage/RemoveAppXProvisionedPackage\n                \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y\"\n                \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n                \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy\"\n                \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy\"\n                \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy\"\n          \n                #Scheduled Tasks to delete\n                \"HKCR:\\Extensions\\ContractId\\Windows.PreInstalledConfigTask\\PackageId\\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe\"\n          \n                #Windows Protocol Keys\n                \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n                \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy\"\n                \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy\"\n                \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy\"\n             \n                #Windows Share Target\n                \"HKCR:\\Extensions\\ContractId\\Windows.ShareTarget\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n            )\n      \n            #This writes the output of each key it is removing and also removes the keys listed above.\n            ForEach ($Key in $Keys) {\n                Write-Host \"Removing $Key from registry\"\n                Remove-Item $Key -Recurse\n            }\n        }\n          \n        Function Protect-Privacy { \n  \n            #Creates a PSDrive to be able to access the 'HKCR' tree\n            New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT\n          \n            #Disables Windows Feedback Experience\n            Write-Host \"Disabling Windows Feedback Experience program\"\n            $Advertising = 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AdvertisingInfo'\n            If (Test-Path $Advertising) {\n                Set-ItemProperty $Advertising Enabled -Value 0\n            }\n          \n            #Stops Cortana from being used as part of your Windows Search Function\n            Write-Host \"Stopping Cortana from being used as part of your Windows Search Function\"\n            $Search = 'HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search'\n            If (Test-Path $Search) {\n                Set-ItemProperty $Search AllowCortana -Value 0\n            }\n          \n            #Stops the Windows Feedback Experience from sending anonymous data\n            Write-Host \"Stopping the Windows Feedback Experience program\"\n            $Period1 = 'HKCU:\\Software\\Microsoft\\Siuf'\n            $Period2 = 'HKCU:\\Software\\Microsoft\\Siuf\\Rules'\n            $Period3 = 'HKCU:\\Software\\Microsoft\\Siuf\\Rules\\PeriodInNanoSeconds'\n            If (!(Test-Path $Period3)) { \n                mkdir $Period1\n                mkdir $Period2\n                mkdir $Period3\n                New-ItemProperty $Period3 PeriodInNanoSeconds -Value 0\n            }\n                 \n            Write-Host \"Adding Registry key to prevent bloatware apps from returning\"\n            #Prevents bloatware applications from returning\n            $registryPath = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\"\n            If (!(Test-Path $registryPath)) {\n                Mkdir $registryPath\n                New-ItemProperty $registryPath DisableWindowsConsumerFeatures -Value 1 \n            }          \n      \n            Write-Host \"Setting Mixed Reality Portal value to 0 so that you can uninstall it in Settings\"\n            $Holo = 'HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Holographic'    \n            If (Test-Path $Holo) {\n                Set-ItemProperty $Holo FirstRunSucceeded -Value 0\n            }\n      \n            #Disables live tiles\n            Write-Host \"Disabling live tiles\"\n            $Live = 'HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CurrentVersion\\PushNotifications'    \n            If (!(Test-Path $Live)) {\n                mkdir $Live  \n                New-ItemProperty $Live NoTileApplicationNotification -Value 1\n            }\n      \n            #Turns off Data Collection via the AllowTelemtry key by changing it to 0\n            Write-Host \"Turning off Data Collection\"\n            $DataCollection = 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection'    \n            If (Test-Path $DataCollection) {\n                Set-ItemProperty $DataCollection AllowTelemetry -Value 0\n            }\n      \n            #Disables People icon on Taskbar\n            Write-Host \"Disabling People icon on Taskbar\"\n            $People = 'HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\People'\n            If (Test-Path $People) {\n                Set-ItemProperty $People PeopleBand -Value 0\n            }\n  \n            #Disables suggestions on start menu\n            Write-Host \"Disabling suggestions on the Start Menu\"\n            $Suggestions = 'HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager'    \n            If (Test-Path $Suggestions) {\n                Set-ItemProperty $Suggestions SystemPaneSuggestionsEnabled -Value 0\n            }\n            \n            Write-Host \"Disabling Bing Search when using Search via the Start Menu\"\n            $BingSearch = 'HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer'\n            If (Test-Path $BingSearch) {\n                Set-ItemProperty $BingSearch DisableSearchBoxSuggestions -Value 1\n            }\n            \n            Write-Host \"Removing CloudStore from registry if it exists\"\n            $CloudStore = 'HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\CloudStore'\n            If (Test-Path $CloudStore) {\n                Stop-Process Explorer.exe -Force\n                Remove-Item $CloudStore -Recurse -Force\n                Start-Process Explorer.exe -Wait\n            }\n\n  \n            #Loads the registry keys/values below into the NTUSER.DAT file which prevents the apps from redownloading. Credit to a60wattfish\n            reg load HKU\\Default_User C:\\Users\\Default\\NTUSER.DAT\n            Set-ItemProperty -Path Registry::HKU\\Default_User\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager -Name SystemPaneSuggestionsEnabled -Value 0\n            Set-ItemProperty -Path Registry::HKU\\Default_User\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager -Name PreInstalledAppsEnabled -Value 0\n            Set-ItemProperty -Path Registry::HKU\\Default_User\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager -Name OemPreInstalledAppsEnabled -Value 0\n            reg unload HKU\\Default_User\n      \n            #Disables scheduled tasks that are considered unnecessary \n            Write-Host \"Disabling scheduled tasks\"\n            #Get-ScheduledTask -TaskName XblGameSaveTaskLogon | Disable-ScheduledTask\n            Get-ScheduledTask -TaskName XblGameSaveTask | Disable-ScheduledTask\n            Get-ScheduledTask -TaskName Consolidator | Disable-ScheduledTask\n            Get-ScheduledTask -TaskName UsbCeip | Disable-ScheduledTask\n            Get-ScheduledTask -TaskName DmClient | Disable-ScheduledTask\n            Get-ScheduledTask -TaskName DmClientOnScenarioDownload | Disable-ScheduledTask\n        }\n\n        Function UnpinStart {\n            # https://superuser.com/a/1442733\n            # Requires -RunAsAdministrator\n\n$START_MENU_LAYOUT = @\"\n<LayoutModificationTemplate xmlns:defaultlayout=\"http://schemas.microsoft.com/Start/2014/FullDefaultLayout\" xmlns:start=\"http://schemas.microsoft.com/Start/2014/StartLayout\" Version=\"1\" xmlns:taskbar=\"http://schemas.microsoft.com/Start/2014/TaskbarLayout\" xmlns=\"http://schemas.microsoft.com/Start/2014/LayoutModification\">\n    <LayoutOptions StartTileGroupCellWidth=\"6\" />\n    <DefaultLayoutOverride>\n        <StartLayoutCollection>\n            <defaultlayout:StartLayout GroupCellWidth=\"6\" />\n        </StartLayoutCollection>\n    </DefaultLayoutOverride>\n</LayoutModificationTemplate>\n\"@\n\n            $layoutFile=\"C:\\Windows\\StartMenuLayout.xml\"\n\n            #Delete layout file if it already exists\n            If(Test-Path $layoutFile)\n            {\n                Remove-Item $layoutFile\n            }\n\n            #Creates the blank layout file\n            $START_MENU_LAYOUT | Out-File $layoutFile -Encoding ASCII\n\n            $regAliases = @(\"HKLM\", \"HKCU\")\n\n            #Assign the start layout and force it to apply with \"LockedStartLayout\" at both the machine and user level\n            foreach ($regAlias in $regAliases){\n                $basePath = $regAlias + \":\\SOFTWARE\\Policies\\Microsoft\\Windows\"\n                $keyPath = $basePath + \"\\Explorer\" \n                IF(!(Test-Path -Path $keyPath)) { \n                    New-Item -Path $basePath -Name \"Explorer\"\n                }\n                Set-ItemProperty -Path $keyPath -Name \"LockedStartLayout\" -Value 1\n                Set-ItemProperty -Path $keyPath -Name \"StartLayoutFile\" -Value $layoutFile\n            }\n\n            #Restart Explorer, open the start menu (necessary to load the new layout), and give it a few seconds to process\n            Stop-Process -name explorer\n            Start-Sleep -s 5\n            $wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('^{ESCAPE}')\n            Start-Sleep -s 5\n\n            #Enable the ability to pin items again by disabling \"LockedStartLayout\"\n            foreach ($regAlias in $regAliases){\n                $basePath = $regAlias + \":\\SOFTWARE\\Policies\\Microsoft\\Windows\"\n                $keyPath = $basePath + \"\\Explorer\" \n                Set-ItemProperty -Path $keyPath -Name \"LockedStartLayout\" -Value 0\n            }\n\n            #Restart Explorer and delete the layout file\n            Stop-Process -name explorer\n\n            # Uncomment the next line to make clean start menu default for all new users\n            #Import-StartLayout -LayoutPath $layoutFile -MountPath $env:SystemDrive\\\n\n            Remove-Item $layoutFile\n        }\n        \n        Function CheckInstallService {\n  \n            If (Get-Service InstallService | Where-Object { $_.Status -eq \"Stopped\" }) {  \n                Start-Service InstallService\n                Set-Service InstallService -StartupType Automatic \n            }\n        }\n  \n        Write-Host \"Initiating Sysprep\"\n        Begin-SysPrep\n        Write-Host \"Removing bloatware apps.\"\n        DebloatAll\n        Write-Host \"Removing leftover bloatware registry keys.\"\n        Remove-Keys\n        Write-Host \"Checking to see if any Allowlisted Apps were removed, and if so re-adding them.\"\n        FixWhitelistedApps\n        Write-Host \"Stopping telemetry, disabling unneccessary scheduled tasks, and preventing bloatware from returning.\"\n        Protect-Privacy\n        Write-Host \"Unpinning tiles from the Start Menu.\"\n        UnpinStart\n        Write-Host \"Setting the 'InstallService' Windows service back to 'Started' and the Startup Type 'Automatic'.\"\n        CheckDMWService\n        CheckInstallService\n        Write-Host \"Finished all tasks. `n\"\n  \n    } )\n$RevertChanges.Add_Click( { \n        $ErrorActionPreference = 'SilentlyContinue'\n        #This function will revert the changes you made when running the Start-Debloat function.\n        \n        #This line reinstalls all of the bloatware that was removed\n        Get-AppxPackage -AllUsers | ForEach { Add-AppxPackage -Verbose -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\" } \n    \n        #Tells Windows to enable your advertising information.    \n        Write-Host \"Re-enabling key to show advertisement information\"\n        $Advertising = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AdvertisingInfo\"\n        If (Test-Path $Advertising) {\n            Set-ItemProperty $Advertising  Enabled -Value 1\n        }\n            \n        #Enables Cortana to be used as part of your Windows Search Function\n        Write-Host \"Re-enabling Cortana to be used in your Windows Search\"\n        $Search = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\"\n        If (Test-Path $Search) {\n            Set-ItemProperty $Search  AllowCortana -Value 1 \n        }\n            \n        #Re-enables the Windows Feedback Experience for sending anonymous data\n        Write-Host \"Re-enabling Windows Feedback Experience\"\n        $Period = \"HKCU:\\Software\\Microsoft\\Siuf\\Rules\"\n        If (!(Test-Path $Period)) { \n            New-Item $Period\n        }\n        Set-ItemProperty $Period PeriodInNanoSeconds -Value 1 \n    \n        #Enables bloatware applications               \n        Write-Host \"Adding Registry key to allow bloatware apps to return\"\n        $registryPath = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\"\n        If (!(Test-Path $registryPath)) {\n            New-Item $registryPath \n        }\n        Set-ItemProperty $registryPath  DisableWindowsConsumerFeatures -Value 0 \n        \n        #Changes Mixed Reality Portal Key 'FirstRunSucceeded' to 1\n        Write-Host \"Setting Mixed Reality Portal value to 1\"\n        $Holo = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Holographic\"\n        If (Test-Path $Holo) {\n            Set-ItemProperty $Holo  FirstRunSucceeded -Value 1 \n        }\n        \n        #Re-enables live tiles\n        Write-Host \"Enabling live tiles\"\n        $Live = \"HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CurrentVersion\\PushNotifications\"\n        If (!(Test-Path $Live)) {\n            New-Item $Live \n        }\n        Set-ItemProperty $Live  NoTileApplicationNotification -Value 0 \n       \n        #Re-enables data collection\n        Write-Host \"Re-enabling data collection\"\n        $DataCollection = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection\"\n        If (!(Test-Path $DataCollection)) {\n            New-Item $DataCollection\n        }\n        Set-ItemProperty $DataCollection  AllowTelemetry -Value 1\n        \n        #Re-enables People Icon on Taskbar\n        Write-Host \"Enabling People Icon on Taskbar\"\n        $People = 'HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\People'\n        If (Test-Path $People) {\n            Set-ItemProperty $People -Name PeopleBand -Value 1 -Verbose\n        }\n    \n        #Re-enables suggestions on start menu\n        Write-Host \"Enabling suggestions on the Start Menu\"\n        $Suggestions = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\"\n        If (!(Test-Path $Suggestions)) {\n            New-Item $Suggestions\n        }\n        Set-ItemProperty $Suggestions  SystemPaneSuggestionsEnabled -Value 1 \n        \n        #Re-enables scheduled tasks that were disabled when running the Debloat switch\n        Write-Host \"Enabling scheduled tasks that were disabled\"\n        Get-ScheduledTask XblGameSaveTaskLogon | Enable-ScheduledTask \n        Get-ScheduledTask  XblGameSaveTask | Enable-ScheduledTask \n        Get-ScheduledTask  Consolidator | Enable-ScheduledTask \n        Get-ScheduledTask  UsbCeip | Enable-ScheduledTask \n        Get-ScheduledTask  DmClient | Enable-ScheduledTask \n        Get-ScheduledTask  DmClientOnScenarioDownload | Enable-ScheduledTask \n\n        Write-Host \"Re-enabling and starting WAP Push Service\"\n        #Enable and start WAP Push Service\n        Set-Service \"dmwappushservice\" -StartupType Automatic\n        Start-Service \"dmwappushservice\"\n    \n        Write-Host \"Re-enabling and starting the Diagnostics Tracking Service\"\n        #Enabling the Diagnostics Tracking Service\n        Set-Service \"DiagTrack\" -StartupType Automatic\n        Start-Service \"DiagTrack\"\n        Write-Host \"Done reverting changes!\"\n\n        #\n        Write-Output \"Restoring 3D Objects from Explorer 'My Computer' submenu\"\n        $Objects32 = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}\"\n        $Objects64 = \"HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}\"\n        If (!(Test-Path $Objects32)) {\n            New-Item $Objects32\n        }\n        If (!(Test-Path $Objects64)) {\n            New-Item $Objects64\n        }\n    })\n$DisableCortana.Add_Click( { \n        $ErrorActionPreference = 'SilentlyContinue'\n        Write-Host \"Disabling Cortana\"\n        $Cortana1 = \"HKCU:\\SOFTWARE\\Microsoft\\Personalization\\Settings\"\n        $Cortana2 = \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\"\n        $Cortana3 = \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\\TrainedDataStore\"\n        If (!(Test-Path $Cortana1)) {\n            New-Item $Cortana1\n        }\n        Set-ItemProperty $Cortana1 AcceptedPrivacyPolicy -Value 0 \n        If (!(Test-Path $Cortana2)) {\n            New-Item $Cortana2\n        }\n        Set-ItemProperty $Cortana2 RestrictImplicitTextCollection -Value 1 \n        Set-ItemProperty $Cortana2 RestrictImplicitInkCollection -Value 1 \n        If (!(Test-Path $Cortana3)) {\n            New-Item $Cortana3\n        }\n        Set-ItemProperty $Cortana3 HarvestContacts -Value 0\n        Write-Host \"Cortana has been disabled.\"\n    })\n$DisableEdgePDFTakeover.Add_Click( { \n        $ErrorActionPreference = 'SilentlyContinue'\n        #Stops edge from taking over as the default .PDF viewer    \n        Write-Host \"Stopping Edge from taking over as the default .PDF viewer\"\n        $NoPDF = \"HKCR:\\.pdf\"\n        $NoProgids = \"HKCR:\\.pdf\\OpenWithProgids\"\n        $NoWithList = \"HKCR:\\.pdf\\OpenWithList\" \n        If (!(Get-ItemProperty $NoPDF  NoOpenWith)) {\n            New-ItemProperty $NoPDF NoOpenWith \n        }        \n        If (!(Get-ItemProperty $NoPDF  NoStaticDefaultVerb)) {\n            New-ItemProperty $NoPDF  NoStaticDefaultVerb \n        }        \n        If (!(Get-ItemProperty $NoProgids  NoOpenWith)) {\n            New-ItemProperty $NoProgids  NoOpenWith \n        }        \n        If (!(Get-ItemProperty $NoProgids  NoStaticDefaultVerb)) {\n            New-ItemProperty $NoProgids  NoStaticDefaultVerb \n        }        \n        If (!(Get-ItemProperty $NoWithList  NoOpenWith)) {\n            New-ItemProperty $NoWithList  NoOpenWith\n        }        \n        If (!(Get-ItemProperty $NoWithList  NoStaticDefaultVerb)) {\n            New-ItemProperty $NoWithList  NoStaticDefaultVerb \n        }\n            \n        #Appends an underscore '_' to the Registry key for Edge\n        $Edge = \"HKCR:\\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_\"\n        If (Test-Path $Edge) {\n            Set-Item $Edge AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_ \n        }\n        Write-Host \"Edge should no longer take over as the default .PDF.\"\n    })\n$EnableCortana.Add_Click( { \n        $ErrorActionPreference = 'SilentlyContinue'\n        Write-Host \"Re-enabling Cortana\"\n        $Cortana1 = \"HKCU:\\SOFTWARE\\Microsoft\\Personalization\\Settings\"\n        $Cortana2 = \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\"\n        $Cortana3 = \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\\TrainedDataStore\"\n        If (!(Test-Path $Cortana1)) {\n            New-Item $Cortana1\n        }\n        Set-ItemProperty $Cortana1 AcceptedPrivacyPolicy -Value 1 \n        If (!(Test-Path $Cortana2)) {\n            New-Item $Cortana2\n        }\n        Set-ItemProperty $Cortana2 RestrictImplicitTextCollection -Value 0 \n        Set-ItemProperty $Cortana2 RestrictImplicitInkCollection -Value 0 \n        If (!(Test-Path $Cortana3)) {\n            New-Item $Cortana3\n        }\n        Set-ItemProperty $Cortana3 HarvestContacts -Value 1 \n        Write-Host \"Cortana has been enabled!\"\n    })\n$EnableEdgePDFTakeover.Add_Click( { \n        New-PSDrive  HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT\n        $ErrorActionPreference = 'SilentlyContinue'\n        Write-Host \"Setting Edge back to default\"\n        $NoPDF = \"HKCR:\\.pdf\"\n        $NoProgids = \"HKCR:\\.pdf\\OpenWithProgids\"\n        $NoWithList = \"HKCR:\\.pdf\\OpenWithList\"\n        #Sets edge back to default\n        If (Get-ItemProperty $NoPDF  NoOpenWith) {\n            Remove-ItemProperty $NoPDF  NoOpenWith\n        } \n        If (Get-ItemProperty $NoPDF  NoStaticDefaultVerb) {\n            Remove-ItemProperty $NoPDF  NoStaticDefaultVerb \n        }       \n        If (Get-ItemProperty $NoProgids  NoOpenWith) {\n            Remove-ItemProperty $NoProgids  NoOpenWith \n        }        \n        If (Get-ItemProperty $NoProgids  NoStaticDefaultVerb) {\n            Remove-ItemProperty $NoProgids  NoStaticDefaultVerb \n        }        \n        If (Get-ItemProperty $NoWithList  NoOpenWith) {\n            Remove-ItemProperty $NoWithList  NoOpenWith\n        }    \n        If (Get-ItemProperty $NoWithList  NoStaticDefaultVerb) {\n            Remove-ItemProperty $NoWithList  NoStaticDefaultVerb\n        }\n        \n        #Removes an underscore '_' from the Registry key for Edge\n        $Edge2 = \"HKCR:\\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_\"\n        If (Test-Path $Edge2) {\n            Set-Item $Edge2 AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723\n        }\n        Write-Host \"Edge will now be able to be used for .PDF.\"\n    })\n$DisableTelemetry.Add_Click( { \n        $ErrorActionPreference = 'SilentlyContinue'\n        #Disables Windows Feedback Experience\n        Write-Host \"Disabling Windows Feedback Experience program\"\n        $Advertising = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AdvertisingInfo\"\n        If (Test-Path $Advertising) {\n            Set-ItemProperty $Advertising Enabled -Value 0 \n        }\n            \n        #Stops Cortana from being used as part of your Windows Search Function\n        Write-Host \"Stopping Cortana from being used as part of your Windows Search Function\"\n        $Search = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\"\n        If (Test-Path $Search) {\n            Set-ItemProperty $Search AllowCortana -Value 0 \n        }\n\n        #Disables Web Search in Start Menu\n        Write-Host \"Disabling Bing Search in Start Menu\"\n        $WebSearch = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\"\n        Set-ItemProperty \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Search\" BingSearchEnabled -Value 0 \n        If (!(Test-Path $WebSearch)) {\n            New-Item $WebSearch\n        }\n        Set-ItemProperty $WebSearch DisableWebSearch -Value 1 \n            \n        #Stops the Windows Feedback Experience from sending anonymous data\n        Write-Host \"Stopping the Windows Feedback Experience program\"\n        $Period = \"HKCU:\\Software\\Microsoft\\Siuf\\Rules\"\n        If (!(Test-Path $Period)) { \n            New-Item $Period\n        }\n        Set-ItemProperty $Period PeriodInNanoSeconds -Value 0 \n\n        #Prevents bloatware applications from returning and removes Start Menu suggestions               \n        Write-Host \"Adding Registry key to prevent bloatware apps from returning\"\n        $registryPath = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\"\n        $registryOEM = \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\"\n        If (!(Test-Path $registryPath)) { \n            New-Item $registryPath\n        }\n        Set-ItemProperty $registryPath DisableWindowsConsumerFeatures -Value 1 \n\n        If (!(Test-Path $registryOEM)) {\n            New-Item $registryOEM\n        }\n        Set-ItemProperty $registryOEM ContentDeliveryAllowed -Value 0 \n        Set-ItemProperty $registryOEM OemPreInstalledAppsEnabled -Value 0 \n        Set-ItemProperty $registryOEM PreInstalledAppsEnabled -Value 0 \n        Set-ItemProperty $registryOEM PreInstalledAppsEverEnabled -Value 0 \n        Set-ItemProperty $registryOEM SilentInstalledAppsEnabled -Value 0 \n        Set-ItemProperty $registryOEM SystemPaneSuggestionsEnabled -Value 0          \n    \n        #Preping mixed Reality Portal for removal    \n        Write-Host \"Setting Mixed Reality Portal value to 0 so that you can uninstall it in Settings\"\n        $Holo = \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Holographic\"    \n        If (Test-Path $Holo) {\n            Set-ItemProperty $Holo  FirstRunSucceeded -Value 0 \n        }\n\n        #Disables Wi-fi Sense\n        Write-Host \"Disabling Wi-Fi Sense\"\n        $WifiSense1 = \"HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\default\\WiFi\\AllowWiFiHotSpotReporting\"\n        $WifiSense2 = \"HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\default\\WiFi\\AllowAutoConnectToWiFiSenseHotspots\"\n        $WifiSense3 = \"HKLM:\\SOFTWARE\\Microsoft\\WcmSvc\\wifinetworkmanager\\config\"\n        If (!(Test-Path $WifiSense1)) {\n            New-Item $WifiSense1\n        }\n        Set-ItemProperty $WifiSense1  Value -Value 0 \n        If (!(Test-Path $WifiSense2)) {\n            New-Item $WifiSense2\n        }\n        Set-ItemProperty $WifiSense2  Value -Value 0 \n        Set-ItemProperty $WifiSense3  AutoConnectAllowedOEM -Value 0 \n        \n        #Disables live tiles\n        Write-Host \"Disabling live tiles\"\n        $Live = \"HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CurrentVersion\\PushNotifications\"    \n        If (!(Test-Path $Live)) {      \n            New-Item $Live\n        }\n        Set-ItemProperty $Live  NoTileApplicationNotification -Value 1 \n        \n        #Turns off Data Collection via the AllowTelemtry key by changing it to 0\n        Write-Host \"Turning off Data Collection\"\n        $DataCollection1 = \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection\"\n        $DataCollection2 = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection\"\n        $DataCollection3 = \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection\"    \n        If (Test-Path $DataCollection1) {\n            Set-ItemProperty $DataCollection1  AllowTelemetry -Value 0 \n        }\n        If (Test-Path $DataCollection2) {\n            Set-ItemProperty $DataCollection2  AllowTelemetry -Value 0 \n        }\n        If (Test-Path $DataCollection3) {\n            Set-ItemProperty $DataCollection3  AllowTelemetry -Value 0 \n        }\n    \n        #Disabling Location Tracking\n        Write-Host \"Disabling Location Tracking\"\n        $SensorState = \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Sensor\\Overrides\\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}\"\n        $LocationConfig = \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\lfsvc\\Service\\Configuration\"\n        If (!(Test-Path $SensorState)) {\n            New-Item $SensorState\n        }\n        Set-ItemProperty $SensorState SensorPermissionState -Value 0 \n        If (!(Test-Path $LocationConfig)) {\n            New-Item $LocationConfig\n        }\n        Set-ItemProperty $LocationConfig Status -Value 0 \n        \n        #Disables People icon on Taskbar\n        Write-Host \"Disabling People icon on Taskbar\"\n        $People = 'HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\People'\n        If (Test-Path $People) {\n            Set-ItemProperty $People -Name PeopleBand -Value 0\n        } \n        \n        #Disables scheduled tasks that are considered unnecessary \n        Write-Host \"Disabling scheduled tasks\"\n        #Get-ScheduledTask XblGameSaveTaskLogon | Disable-ScheduledTask\n        Get-ScheduledTask XblGameSaveTask | Disable-ScheduledTask\n        Get-ScheduledTask Consolidator | Disable-ScheduledTask\n        Get-ScheduledTask UsbCeip | Disable-ScheduledTask\n        Get-ScheduledTask DmClient | Disable-ScheduledTask\n        Get-ScheduledTask DmClientOnScenarioDownload | Disable-ScheduledTask\n\n        #Write-Host \"Uninstalling Telemetry Windows Updates\"\n        #Uninstalls Some Windows Updates considered to be Telemetry. !WIP!\n        #Wusa /Uninstall /KB:3022345 /norestart /quiet\n        #Wusa /Uninstall /KB:3068708 /norestart /quiet\n        #Wusa /Uninstall /KB:3075249 /norestart /quiet\n        #Wusa /Uninstall /KB:3080149 /norestart /quiet        \n\n        Write-Host \"Stopping and disabling WAP Push Service\"\n        #Stop and disable WAP Push Service\n        Stop-Service \"dmwappushservice\"\n        Set-Service \"dmwappushservice\" -StartupType Disabled\n\n        Write-Host \"Stopping and disabling Diagnostics Tracking Service\"\n        #Disabling the Diagnostics Tracking Service\n        Stop-Service \"DiagTrack\"\n        Set-Service \"DiagTrack\" -StartupType Disabled\n        Write-Host \"Telemetry has been disabled!\"\n    })\n$RemoveRegkeys.Add_Click( { \n        $ErrorActionPreference = 'SilentlyContinue'\n        $Keys = @(\n            \n            New-PSDrive  HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT\n            #Remove Background Tasks\n            \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y\"\n            \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n            \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe\"\n            \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy\"\n            \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy\"\n            \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy\"\n            \n            #Windows File\n            \"HKCR:\\Extensions\\ContractId\\Windows.File\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n            \n            #Registry keys to delete if they aren't uninstalled by RemoveAppXPackage/RemoveAppXProvisionedPackage\n            \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y\"\n            \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n            \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy\"\n            \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy\"\n            \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy\"\n            \n            #Scheduled Tasks to delete\n            \"HKCR:\\Extensions\\ContractId\\Windows.PreInstalledConfigTask\\PackageId\\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe\"\n            \n            #Windows Protocol Keys\n            \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n            \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy\"\n            \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy\"\n            \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy\"\n               \n            #Windows Share Target\n            \"HKCR:\\Extensions\\ContractId\\Windows.ShareTarget\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n        )\n        \n        #This writes the output of each key it is removing and also removes the keys listed above.\n        ForEach ($Key in $Keys) {\n            Write-Host \"Removing $Key from registry\"\n            Remove-Item $Key -Recurse\n        }\n        Write-Host \"Additional bloatware keys have been removed!\"\n    })\n$UnpinStartMenuTiles.Add_Click( {\n        #https://superuser.com/questions/1068382/how-to-remove-all-the-tiles-in-the-windows-10-start-menu\n        #Unpins all tiles from the Start Menu\n        Write-Host \"Unpinning all tiles from the start menu\"\n        (New-Object -Com Shell.Application).\n        NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').\n        Items() |\n        % { $_.Verbs() } |\n        ? { $_.Name -match 'Un.*pin from Start' } |\n        % { $_.DoIt() }\n    })\n\n$RemoveOnedrive.Add_Click( { \n        If (Test-Path \"$env:USERPROFILE\\OneDrive\\*\") {\n            Write-Host \"Files found within the OneDrive folder! Checking to see if a folder named OneDriveBackupFiles exists.\"\n            Start-Sleep 1\n              \n            If (Test-Path \"$env:USERPROFILE\\Desktop\\OneDriveBackupFiles\") {\n                Write-Host \"A folder named OneDriveBackupFiles already exists on your desktop. All files from your OneDrive location will be moved to that folder.\" \n            }\n            else {\n                If (!(Test-Path \"$env:USERPROFILE\\Desktop\\OneDriveBackupFiles\")) {\n                    Write-Host \"A folder named OneDriveBackupFiles will be created and will be located on your desktop. All files from your OneDrive location will be located in that folder.\"\n                    New-item -Path \"$env:USERPROFILE\\Desktop\" -Name \"OneDriveBackupFiles\"-ItemType Directory -Force\n                    Write-Host \"Successfully created the folder 'OneDriveBackupFiles' on your desktop.\"\n                }\n            }\n            Start-Sleep 1\n            Move-Item -Path \"$env:USERPROFILE\\OneDrive\\*\" -Destination \"$env:USERPROFILE\\Desktop\\OneDriveBackupFiles\" -Force\n            Write-Host \"Successfully moved all files/folders from your OneDrive folder to the folder 'OneDriveBackupFiles' on your desktop.\"\n            Start-Sleep 1\n            Write-Host \"Proceeding with the removal of OneDrive.\"\n            Start-Sleep 1\n        }\n        Else {\n            Write-Host \"Either the OneDrive folder does not exist or there are no files to be found in the folder. Proceeding with removal of OneDrive.\"\n            Start-Sleep 1\n            Write-Host \"Enabling the Group Policy 'Prevent the usage of OneDrive for File Storage'.\"\n            $OneDriveKey = 'HKLM:Software\\Policies\\Microsoft\\Windows\\OneDrive'\n            If (!(Test-Path $OneDriveKey)) {\n                Mkdir $OneDriveKey\n                Set-ItemProperty $OneDriveKey -Name OneDrive -Value DisableFileSyncNGSC\n            }\n            Set-ItemProperty $OneDriveKey -Name OneDrive -Value DisableFileSyncNGSC\n        }\n\n        Write-Host \"Uninstalling OneDrive. Please wait...\"\n    \n        New-PSDrive  HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT\n        $onedrive = \"$env:SYSTEMROOT\\SysWOW64\\OneDriveSetup.exe\"\n        $ExplorerReg1 = \"HKCR:\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\"\n        $ExplorerReg2 = \"HKCR:\\Wow6432Node\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\"\n        Stop-Process -Name \"OneDrive*\"\n        Start-Sleep 2\n        If (!(Test-Path $onedrive)) {\n            $onedrive = \"$env:SYSTEMROOT\\System32\\OneDriveSetup.exe\"\n        }\n        Start-Process $onedrive \"/uninstall\" -NoNewWindow -Wait\n        Start-Sleep 2\n        Write-Host \"Stopping explorer\"\n        Start-Sleep 1\n        taskkill.exe /F /IM explorer.exe\n        Start-Sleep 3\n        Write-Host \"Removing leftover files\"\n        If (Test-Path \"$env:USERPROFILE\\OneDrive\") {\n            Remove-Item \"$env:USERPROFILE\\OneDrive\" -Force -Recurse\n        }\n        If (Test-Path \"$env:LOCALAPPDATA\\Microsoft\\OneDrive\") {\n            Remove-Item \"$env:LOCALAPPDATA\\Microsoft\\OneDrive\" -Force -Recurse\n        }\n        If (Test-Path \"$env:PROGRAMDATA\\Microsoft OneDrive\") {\n            Remove-Item \"$env:PROGRAMDATA\\Microsoft OneDrive\" -Force -Recurse\n        }\n        If (Test-Path \"$env:SYSTEMDRIVE\\OneDriveTemp\") {\n            Remove-Item \"$env:SYSTEMDRIVE\\OneDriveTemp\" -Force -Recurse\n        }\n        Write-Host \"Removing OneDrive from windows explorer\"\n        If (!(Test-Path $ExplorerReg1)) {\n            New-Item $ExplorerReg1\n        }\n        Set-ItemProperty $ExplorerReg1 System.IsPinnedToNameSpaceTree -Value 0 \n        If (!(Test-Path $ExplorerReg2)) {\n            New-Item $ExplorerReg2\n        }\n        Set-ItemProperty $ExplorerReg2 System.IsPinnedToNameSpaceTree -Value 0\n        Write-Host \"Restarting Explorer that was shut down before.\"\n        Start-Process explorer.exe -NoNewWindow\n        Write-Host \"OneDrive has been successfully uninstalled!\"\n        \n        Remove-item env:OneDrive\n    })\n\n$InstallNet35.Add_Click( {\n\n        Write-Host \"Initializing the installation of .NET 3.5...\"\n        DISM /Online /Enable-Feature /FeatureName:NetFx3 /All\n        Write-Host \".NET 3.5 has been successfully installed!\"\n    } )\n\n$EnableDarkMode.Add_Click( {\n        Write-Host \"Enabling Dark Mode\"\n        $Theme = \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize\"\n        Set-ItemProperty $Theme AppsUseLightTheme -Value 0\n        Start-Sleep 1\n        Write-Host \"Enabled\"\n    }\n)\n\n$DisableDarkMode.Add_Click( {\n        Write-Host \"Disabling Dark Mode\"\n        $Theme = \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize\"\n        Set-ItemProperty $Theme AppsUseLightTheme -Value 1\n        Start-Sleep 1\n        Write-Host \"Disabled\"\n    }\n)\n\n[void]$Form.ShowDialog()\n"
  },
  {
    "path": "Windows10SysPrepDebloater.ps1",
    "content": "#This function finds any AppX/AppXProvisioned package and uninstalls it, except for Freshpaint, Windows Calculator, Windows Store, and Windows Photos.\n#Also, to note - This does NOT remove essential system services/software/etc such as .NET framework installations, Cortana, Edge, etc.\n\n#This is the switch parameter for running this script as a 'silent' script, for use in MDT images or any type of mass deployment without user interaction.\n\nparam (\n  [switch]$Debloat, [switch]$SysPrep\n)\n\nFunction Begin-SysPrep {\n\n    param([switch]$SysPrep)\n        Write-Verbose -Message ('Starting Sysprep Fixes')\n \n        # Disable Windows Store Automatic Updates\n       <# Write-Verbose -Message \"Adding Registry key to Disable Windows Store Automatic Updates\"\n        $registryPath = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\WindowsStore\"\n        If (!(Test-Path $registryPath)) {\n            Mkdir $registryPath -ErrorAction SilentlyContinue\n            New-ItemProperty $registryPath -Name AutoDownload -Value 2 \n        }\n        Else {\n            Set-ItemProperty $registryPath -Name AutoDownload -Value 2 \n        }\n        #Stop WindowsStore Installer Service and set to Disabled\n        Write-Verbose -Message ('Stopping InstallService')\n        Stop-Service InstallService \n        #>\n } \n\n#Creates a PSDrive to be able to access the 'HKCR' tree\nNew-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT\nFunction Start-Debloat {\n    \n    param([switch]$Debloat)\n\n    #Removes AppxPackages\n    #Credit to Reddit user /u/GavinEke for a modified version of my whitelist code\n    [regex]$WhitelistedApps = 'Microsoft.ScreenSketch|Microsoft.Paint3D|Microsoft.WindowsCalculator|Microsoft.WindowsStore|Microsoft.Windows.Photos|CanonicalGroupLimited.UbuntuonWindows|`\n    Microsoft.MicrosoftStickyNotes|Microsoft.MSPaint|Microsoft.WindowsCamera|.NET|Framework|Microsoft.HEIFImageExtension|Microsoft.ScreenSketch|Microsoft.StorePurchaseApp|`\n    Microsoft.VP9VideoExtensions|Microsoft.WebMediaExtensions|Microsoft.WebpImageExtension|Microsoft.DesktopAppInstaller'\n    Get-AppxPackage -AllUsers | Where-Object {$_.Name -NotMatch $WhitelistedApps} | Remove-AppxPackage -ErrorAction SilentlyContinue\n    # Run this again to avoid error on 1803 or having to reboot.\n    Get-AppxPackage -AllUsers | Where-Object {$_.Name -NotMatch $WhitelistedApps} | Remove-AppxPackage -ErrorAction SilentlyContinue\n    $AppxRemoval = Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName -NotMatch $WhitelistedApps} \n    ForEach ( $App in $AppxRemoval) {\n    \n        Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName \n        \n        }\n}\n\nFunction Remove-Keys {\n        \n    Param([switch]$Debloat)    \n    \n    #These are the registry keys that it will delete.\n        \n    $Keys = @(\n        \n        #Remove Background Tasks\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.BackgroundTasks\\PackageId\\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy\"\n        \n        #Windows File\n        \"HKCR:\\Extensions\\ContractId\\Windows.File\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n        \n        #Registry keys to delete if they aren't uninstalled by RemoveAppXPackage/RemoveAppXProvisionedPackage\n        \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Launch\\PackageId\\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy\"\n        \n        #Scheduled Tasks to delete\n        \"HKCR:\\Extensions\\ContractId\\Windows.PreInstalledConfigTask\\PackageId\\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe\"\n        \n        #Windows Protocol Keys\n        \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy\"\n        \"HKCR:\\Extensions\\ContractId\\Windows.Protocol\\PackageId\\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy\"\n           \n        #Windows Share Target\n        \"HKCR:\\Extensions\\ContractId\\Windows.ShareTarget\\PackageId\\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0\"\n    )\n    \n    #This writes the output of each key it is removing and also removes the keys listed above.\n    ForEach ($Key in $Keys) {\n        Write-Output \"Removing $Key from registry\"\n        Remove-Item $Key -Recurse -ErrorAction SilentlyContinue\n    }\n}\n        \nFunction Protect-Privacy {\n    \n    Param([switch]$Debloat)    \n\n    #Creates a PSDrive to be able to access the 'HKCR' tree\n    New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT\n        \n    #Disables Windows Feedback Experience\n    Write-Output \"Disabling Windows Feedback Experience program\"\n    $Advertising = 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AdvertisingInfo'\n    If (Test-Path $Advertising) {\n        Set-ItemProperty $Advertising -Name Enabled -Value 0 -Verbose\n    }\n        \n    #Stops Cortana from being used as part of your Windows Search Function\n    Write-Output \"Stopping Cortana from being used as part of your Windows Search Function\"\n    $Search = 'HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search'\n    If (Test-Path $Search) {\n        Set-ItemProperty $Search -Name AllowCortana -Value 0 -Verbose\n    }\n        \n    #Stops the Windows Feedback Experience from sending anonymous data\n    Write-Output \"Stopping the Windows Feedback Experience program\"\n    $Period1 = 'HKCU:\\Software\\Microsoft\\Siuf'\n    $Period2 = 'HKCU:\\Software\\Microsoft\\Siuf\\Rules'\n    $Period3 = 'HKCU:\\Software\\Microsoft\\Siuf\\Rules\\PeriodInNanoSeconds'\n    If (!(Test-Path $Period3)) { \n        mkdir $Period1 -ErrorAction SilentlyContinue\n        mkdir $Period2 -ErrorAction SilentlyContinue\n        mkdir $Period3 -ErrorAction SilentlyContinue\n        New-ItemProperty $Period3 -Name PeriodInNanoSeconds -Value 0 -Verbose -ErrorAction SilentlyContinue\n    }\n               \n    Write-Output \"Adding Registry key to prevent bloatware apps from returning\"\n    #Prevents bloatware applications from returning\n    $registryPath = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\"\n    If (!(Test-Path $registryPath)) {\n        Mkdir $registryPath -ErrorAction SilentlyContinue\n        New-ItemProperty $registryPath -Name DisableWindowsConsumerFeatures -Value 1 -Verbose -ErrorAction SilentlyContinue\n    }          \n    \n    Write-Output \"Setting Mixed Reality Portal value to 0 so that you can uninstall it in Settings\"\n    $Holo = 'HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Holographic'    \n    If (Test-Path $Holo) {\n        Set-ItemProperty $Holo -Name FirstRunSucceeded -Value 0 -Verbose\n    }\n    \n    #Disables live tiles\n    Write-Output \"Disabling live tiles\"\n    $Live = 'HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CurrentVersion\\PushNotifications'    \n    If (!(Test-Path $Live)) {\n        mkdir $Live -ErrorAction SilentlyContinue     \n        New-ItemProperty $Live -Name NoTileApplicationNotification -Value 1 -Verbose\n    }\n    \n    #Turns off Data Collection via the AllowTelemtry key by changing it to 0\n    Write-Output \"Turning off Data Collection\"\n    $DataCollection = 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection'    \n    If (Test-Path $DataCollection) {\n        Set-ItemProperty $DataCollection -Name AllowTelemetry -Value 0 -Verbose\n    }\n    \n    #Disables People icon on Taskbar\n    Write-Output \"Disabling People icon on Taskbar\"\n    $People = 'HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\People'\n    If (Test-Path $People) {\n        Set-ItemProperty $People -Name PeopleBand -Value 0 -Verbose\n    }\n\n    #Disables suggestions on start menu\n    Write-Output \"Disabling suggestions on the Start Menu\"\n    $Suggestions = 'HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager'    \n    If (Test-Path $Suggestions) {\n        Set-ItemProperty $Suggestions -Name SystemPaneSuggestionsEnabled -Value 0 -Verbose\n    }\n    \n    \n     Write-Output \"Removing CloudStore from registry if it exists\"\n     $CloudStore = 'HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\CloudStore'\n     If (Test-Path $CloudStore) {\n     Stop-Process -Name explorer -Force\n     Remove-Item $CloudStore -Recurse -Force\n     Start-Process Explorer.exe -Wait\n    }\n\n    #Loads the registry keys/values below into the NTUSER.DAT file which prevents the apps from redownloading. Credit to a60wattfish\n    reg load HKU\\Default_User C:\\Users\\Default\\NTUSER.DAT\n    Set-ItemProperty -Path Registry::HKU\\Default_User\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager -Name SystemPaneSuggestionsEnabled -Value 0\n    Set-ItemProperty -Path Registry::HKU\\Default_User\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager -Name PreInstalledAppsEnabled -Value 0\n    Set-ItemProperty -Path Registry::HKU\\Default_User\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager -Name OemPreInstalledAppsEnabled -Value 0\n    reg unload HKU\\Default_User\n    \n    #Disables scheduled tasks that are considered unnecessary \n    Write-Output \"Disabling scheduled tasks\"\n    #Get-ScheduledTask -TaskName XblGameSaveTaskLogon | Disable-ScheduledTask -ErrorAction SilentlyContinue\n    Get-ScheduledTask -TaskName XblGameSaveTask | Disable-ScheduledTask -ErrorAction SilentlyContinue\n    Get-ScheduledTask -TaskName Consolidator | Disable-ScheduledTask -ErrorAction SilentlyContinue\n    Get-ScheduledTask -TaskName UsbCeip | Disable-ScheduledTask -ErrorAction SilentlyContinue\n    Get-ScheduledTask -TaskName DmClient | Disable-ScheduledTask -ErrorAction SilentlyContinue\n    Get-ScheduledTask -TaskName DmClientOnScenarioDownload | Disable-ScheduledTask -ErrorAction SilentlyContinue\n}\n\n#This includes fixes by xsisbest\nFunction FixWhitelistedApps {\n    \n    Param([switch]$Debloat)\n    \n    If(!(Get-AppxPackage -AllUsers | Select Microsoft.Paint3D, Microsoft.MSPaint, Microsoft.WindowsCalculator, Microsoft.WindowsStore, Microsoft.MicrosoftStickyNotes, Microsoft.WindowsSoundRecorder, Microsoft.Windows.Photos)) {\n    \n    #Credit to abulgatz for the 4 lines of code\n    Get-AppxPackage -allusers Microsoft.Paint3D | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n    Get-AppxPackage -allusers Microsoft.MSPaint | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n    Get-AppxPackage -allusers Microsoft.WindowsCalculator | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n    Get-AppxPackage -allusers Microsoft.WindowsStore | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n    Get-AppxPackage -allusers Microsoft.MicrosoftStickyNotes | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n    Get-AppxPackage -allusers Microsoft.WindowsSoundRecorder | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n    Get-AppxPackage -allusers Microsoft.Windows.Photos | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"} }\n}\n\nFunction CheckDMWService {\n\n  Param([switch]$Debloat)\n  \nIf (Get-Service -Name dmwappushservice | Where-Object {$_.StartType -eq \"Disabled\"}) {\n    Set-Service -Name dmwappushservice -StartupType Automatic}\n\nIf(Get-Service -Name dmwappushservice | Where-Object {$_.Status -eq \"Stopped\"}) {\n   Start-Service -Name dmwappushservice} \n  }\n\nFunction CheckInstallService {\n  Param([switch]$Debloat)\n          If (Get-Service -Name InstallService | Where-Object {$_.Status -eq \"Stopped\"}) {  \n            Start-Service -Name InstallService\n            Set-Service -Name InstallService -StartupType Automatic \n            }\n        }\n\nWrite-Output \"Initiating Sysprep\"\nBegin-SysPrep\nWrite-Output \"Removing bloatware apps.\"\nStart-Debloat\nWrite-Output \"Removing leftover bloatware registry keys.\"\nRemove-Keys\nWrite-Output \"Checking to see if any Whitelisted Apps were removed, and if so re-adding them.\"\nFixWhitelistedApps\nWrite-Output \"Stopping telemetry, disabling unneccessary scheduled tasks, and preventing bloatware from returning.\"\nProtect-Privacy\n#Write-Output \"Stopping Edge from taking over as the default PDF Viewer.\"\n#Stop-EdgePDF\nCheckDMWService\nCheckInstallService\nWrite-Output \"Finished all tasks.\"\n"
  }
]