From 8a6dc693307af62bc6f5fdf12766cf02fa025a9c Mon Sep 17 00:00:00 2001 From: Nyneava Date: Mon, 17 Aug 2020 06:36:01 -0400 Subject: [PATCH] + Added ability to enable or disable Xbox GameDVR --- .gitignore | 2 + Individual Scripts/Disable Xbox GameDVR | 11 ++++ Individual Scripts/Enable Xbox GameDVR | 11 ++++ Individual Scripts/Revert Changes | 16 +++++- Windows10Debloater.ps1 | 69 ++++++++++++++++++++----- Windows10DebloaterGUI.ps1 | 52 ++++++++++++++++++- 6 files changed, 145 insertions(+), 16 deletions(-) create mode 100644 .gitignore create mode 100644 Individual Scripts/Disable Xbox GameDVR create mode 100644 Individual Scripts/Enable Xbox GameDVR diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a39c1ad --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +.vs \ No newline at end of file diff --git a/Individual Scripts/Disable Xbox GameDVR b/Individual Scripts/Disable Xbox GameDVR new file mode 100644 index 0000000..8edc9f0 --- /dev/null +++ b/Individual Scripts/Disable Xbox GameDVR @@ -0,0 +1,11 @@ +Write-Host "Disabling Xbox GameDVR" + $GameDVR1 = "HKCU:\System\GameConfigStore" + $GameDVR2 = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" + If (!(Test-Path $GameDVR1)) { + New-Item $GameDVR1 + } + Set-ItemProperty $GameDVR1 GameDVR_Enabled -Value 0 + If (!(Test-Path $GameDVR2)) { + New-Item $GameDVR2 + } + Set-ItemProperty $GameDVR2 AllowGameDVR -Value 0 diff --git a/Individual Scripts/Enable Xbox GameDVR b/Individual Scripts/Enable Xbox GameDVR new file mode 100644 index 0000000..b8a9a9b --- /dev/null +++ b/Individual Scripts/Enable Xbox GameDVR @@ -0,0 +1,11 @@ +Write-Host "Re-enabling Xbox GameDVR" + $GameDVR1 = "HKCU:\System\GameConfigStore" + $GameDVR2 = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" + If (!(Test-Path $GameDVR1)) { + New-Item $GameDVR1 + } + Set-ItemProperty $GameDVR1 GameDVR_Enabled -Value 1 + If (!(Test-Path $GameDVR2)) { + New-Item $GameDVR2 + } + Set-ItemProperty $GameDVR2 AllowGameDVR -Value 1 diff --git a/Individual Scripts/Revert Changes b/Individual Scripts/Revert Changes index e52504a..7b59c76 100644 --- a/Individual Scripts/Revert Changes +++ b/Individual Scripts/Revert Changes @@ -9,7 +9,20 @@ If (Test-Path $Advertising) { Set-ItemProperty $Advertising Enabled -Value 1 } - + + #Enables Xbox GameDVR + Write-Output "Re-enabling Xbox GameDVR" + $GameDVR1 = "HKCU:\System\GameConfigStore" + $GameDVR2 = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" + If (!(Test-Path $GameDVR1)) { + New-Item $GameDVR1 + } + Set-ItemProperty $GameDVR1 GameDVR_Enabled -Value 1 + If (!(Test-Path $GameDVR2)) { + New-Item $GameDVR2 + } + Set-ItemProperty $GameDVR2 AllowGameDVR -Value 1 + #Enables Cortana to be used as part of your Windows Search Function Write-Output "Re-enabling Cortana to be used in your Windows Search" $Search = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" @@ -90,3 +103,4 @@ #Enabling the Diagnostics Tracking Service Set-Service "DiagTrack" -StartupType Automatic Start-Service "DiagTrack" + diff --git a/Windows10Debloater.ps1 b/Windows10Debloater.ps1 index 01a085c..3af2b50 100644 --- a/Windows10Debloater.ps1 +++ b/Windows10Debloater.ps1 @@ -351,7 +351,35 @@ Function EnableCortana { } Set-ItemProperty $Cortana3 HarvestContacts -Value 1 } - + +Function DisableXboxGameDVR { + Write-Host "Disabling Xbox GameDVR" + $GameDVR1 = "HKCU:\System\GameConfigStore" + $GameDVR2 = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" + If (!(Test-Path $GameDVR1)) { + New-Item $GameDVR1 + } + Set-ItemProperty $GameDVR1 GameDVR_Enabled -Value 0 + If (!(Test-Path $GameDVR2)) { + New-Item $GameDVR2 + } + Set-ItemProperty $GameDVR2 AllowGameDVR -Value 0 +} + +Function EnableXboxGameDVR { + Write-Host "Disabling Xbox GameDVR" + $GameDVR1 = "HKCU:\System\GameConfigStore" + $GameDVR2 = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" + If (!(Test-Path $GameDVR1)) { + New-Item $GameDVR1 + } + Set-ItemProperty $GameDVR1 GameDVR_Enabled -Value 1 + If (!(Test-Path $GameDVR2)) { + New-Item $GameDVR2 + } + Set-ItemProperty $GameDVR2 AllowGameDVR -Value 1 +} + Function Stop-EdgePDF { #Stops edge from taking over as the default .PDF viewer @@ -719,6 +747,7 @@ $Ask = 'The following will allow you to either Debloat Windows 10 or to revert c $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." $EdgePdf = "Do you want to stop edge from taking over as the default PDF viewer?" $EdgePdf2 = "Do you want to revert changes that disabled Edge as the default PDF viewer?" +$XboxGameDVR = "Do you want to disable Xbox GameDVR?" $Reboot = "For some of the changes to properly take effect it is recommended to reboot your machine. Would you like to restart?" $OneDriveDelete = "Do you want to uninstall One Drive?" $Unpin = "Do you want to unpin all items from the Start menu?" @@ -794,6 +823,9 @@ Switch ($Prompt1) { DisableDiagTrack Write-Host "Diagnostics Tracking Service disabled" Start-Sleep 1 + DisableXboxGameDVR + Write-Host "Disabled Xbox GameDVR" + Start-Sleep 1 Write-Host "Disabling WAP push service" Start-Sleep 1 DisableWAPPush @@ -813,9 +845,20 @@ Switch ($Prompt1) { Write-Host "You chose not to stop Edge from taking over as the default PDF viewer." } } - #Prompt asking to delete OneDrive - $Prompt4 = [Windows.MessageBox]::Show($OneDriveDelete, "Delete OneDrive", $Button, $ErrorIco) + #Disabling EdgePDF prompt + $Prompt4 = [Windows.MessageBox]::Show($XboxGameDVR, "Xbox GameDVR", $Button, $Warn) Switch ($Prompt4) { + Yes { + DisableXboxGameDVR + Write-Host "Xbox GameDVR is no longer enabled" + } + No { + Write-Host "You chose not to disable Xbox GameDVR." + } + } + #Prompt asking to delete OneDrive + $Prompt5 = [Windows.MessageBox]::Show($OneDriveDelete, "Delete OneDrive", $Button, $ErrorIco) + Switch ($Prompt5) { Yes { UninstallOneDrive Write-Host "OneDrive is now removed from the computer." @@ -825,8 +868,8 @@ Switch ($Prompt1) { } } #Prompt asking if you'd like to unpin all start items - $Prompt5 = [Windows.MessageBox]::Show($Unpin, "Unpin", $Button, $ErrorIco) - Switch ($Prompt5) { + $Prompt6 = [Windows.MessageBox]::Show($Unpin, "Unpin", $Button, $ErrorIco) + Switch ($Prompt6) { Yes { UnpinStart Write-Host "Start Apps unpined." @@ -837,8 +880,8 @@ Switch ($Prompt1) { } } #Prompt asking if you want to install .NET - $Prompt6 = [Windows.MessageBox]::Show($InstallNET, "Install .Net", $Button, $Warn) - Switch ($Prompt6) { + $Prompt7 = [Windows.MessageBox]::Show($InstallNET, "Install .Net", $Button, $Warn) + Switch ($Prompt7) { Yes { Write-Host "Initializing the installation of .NET 3.5..." DISM /Online /Enable-Feature /FeatureName:NetFx3 /All @@ -849,8 +892,8 @@ Switch ($Prompt1) { } } #Prompt asking if you'd like to reboot your machine - $Prompt7 = [Windows.MessageBox]::Show($Reboot, "Reboot", $Button, $Warn) - Switch ($Prompt7) { + $Prompt8 = [Windows.MessageBox]::Show($Reboot, "Reboot", $Button, $Warn) + Switch ($Prompt8) { Yes { Write-Host "Unloading the HKCR drive..." Remove-PSDrive HKCR @@ -877,8 +920,8 @@ Switch ($Prompt1) { New-PSDrive HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT Revert-Changes #Prompt asking to revert edge changes as well - $Prompt6 = [Windows.MessageBox]::Show($EdgePdf2, "Revert Edge", $Button, $ErrorIco) - Switch ($Prompt6) { + $Prompt7 = [Windows.MessageBox]::Show($EdgePdf2, "Revert Edge", $Button, $ErrorIco) + Switch ($Prompt7) { Yes { Enable-EdgePDF Write-Host "Edge will no longer be disabled from being used as the default Edge PDF viewer." @@ -888,8 +931,8 @@ Switch ($Prompt1) { } } #Prompt asking if you'd like to reboot your machine - $Prompt7 = [Windows.MessageBox]::Show($Reboot, "Reboot", $Button, $Warn) - Switch ($Prompt7) { + $Prompt8 = [Windows.MessageBox]::Show($Reboot, "Reboot", $Button, $Warn) + Switch ($Prompt8) { Yes { Write-Host "Unloading the HKCR drive..." Remove-PSDrive HKCR diff --git a/Windows10DebloaterGUI.ps1 b/Windows10DebloaterGUI.ps1 index 587ff12..a21cbea 100644 --- a/Windows10DebloaterGUI.ps1 +++ b/Windows10DebloaterGUI.ps1 @@ -336,7 +336,7 @@ $InstallNet35 = New-Object System.Windows.Forms.Button $InstallNet35.Text = "Install .NET v3.5" $InstallNet35.Width = 152 $InstallNet35.Height = 39 -$InstallNet35.Location = New-Object System.Drawing.Point(169, 335) +$InstallNet35.Location = New-Object System.Drawing.Point(329, 335) $InstallNet35.Font = 'Microsoft Sans Serif,10' $EnableDarkMode = New-Object System.Windows.Forms.Button @@ -353,9 +353,23 @@ $DisableDarkMode.Height = 39 $DisableDarkMode.Location = New-Object System.Drawing.Point(9, 385) $DisableDarkMode.Font = 'Microsoft Sans Serif,10' +$DisableXboxGameDVR = New-Object System.Windows.Forms.Button +$DisableXboxGameDVR.Text = "Disable Xbox GameDVR" +$DisableXboxGameDVR.Width = 152 +$DisableXboxGameDVR.Height = 39 +$DisableXboxGameDVR.Location = New-Object System.Drawing.Point(169, 335) +$DisableXboxGameDVR.Font = 'Microsoft Sans Serif,10' +$EnableXboxGameDVR = New-Object System.Windows.Forms.Button +$EnableXboxGameDVR.Text = "Enable Xbox GameDVR" +$EnableXboxGameDVR.Width = 152 +$EnableXboxGameDVR.Height = 39 +$EnableXboxGameDVR.Location = New-Object System.Drawing.Point(169, 385) +$EnableXboxGameDVR.Font = 'Microsoft Sans Serif,10' -$Form.controls.AddRange(@($Debloat, $CustomizeBlacklists, $RemoveAllBloatware, $RemoveBlacklist, $Label1, $RevertChange, $Label2, $DisableCortana, $EnableCortana, $StopEdgePDFTakeover, $EnableEdgePDFTakeover, $DisableTelemetry, $RemoveRegkeys, $UnpinStartMenuTiles, $RemoveOnedrive, $FixWhitelist, $RemoveBloatNoBlacklist, $InstallNet35, $EnableDarkMode, $DisableDarkMode)) + + +$Form.controls.AddRange(@($Debloat, $CustomizeBlacklists, $RemoveAllBloatware, $RemoveBlacklist, $Label1, $RevertChange, $Label2, $DisableCortana, $EnableCortana, $StopEdgePDFTakeover, $EnableEdgePDFTakeover, $DisableTelemetry, $RemoveRegkeys, $UnpinStartMenuTiles, $RemoveOnedrive, $FixWhitelist, $RemoveBloatNoBlacklist, $InstallNet35, $EnableDarkMode, $DisableDarkMode, $DisableXboxGameDVR, $EnableXboxGameDVR)) $DebloatFolder = "C:\Temp\Windows10Debloater" If (Test-Path $DebloatFolder) { @@ -1307,4 +1321,38 @@ $DisableDarkMode.Add_Click( { } ) +$DisableXboxGameDVR.Add_Click( { + Write-Host "Disabling Xbox GameDVR" + $GameDVR1 = "HKCU:\System\GameConfigStore" + $GameDVR2 = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" + If (!(Test-Path $GameDVR1)) { + New-Item $GameDVR1 + } + Set-ItemProperty $GameDVR1 GameDVR_Enabled -Value 0 + If (!(Test-Path $GameDVR2)) { + New-Item $GameDVR2 + } + Set-ItemProperty $GameDVR2 AllowGameDVR -Value 0 + Start-Sleep 1 + Write-Host "Disabled" + } +) + +$EnableXboxGameDVR.Add_Click( { + Write-Host "Enabling Xbox GameDVR" + $GameDVR1 = "HKCU:\System\GameConfigStore" + $GameDVR2 = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" + If (!(Test-Path $GameDVR1)) { + New-Item $GameDVR1 + } + Set-ItemProperty $GameDVR1 GameDVR_Enabled -Value 1 + If (!(Test-Path $GameDVR2)) { + New-Item $GameDVR2 + } + Set-ItemProperty $GameDVR2 AllowGameDVR -Value 1 + Start-Sleep 1 + Write-Host "Enabled" + } +) + [void]$Form.ShowDialog()