@ -8,9 +8,10 @@ Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"
$DesktopPath = [ Environment ] :: GetFolderPath ( " Desktop " ) ;
$PathToLMPoliciesCloudContent = " HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent "
$PathToLMPolicies System = " HKLM:\SOFTWARE\Policies\Microsoft\Windows\System "
$PathToLMPolicies AppGameDVR = " HKLM:\SOFTWARE\Microsoft\PolicyManager\default\ApplicationManagement\AllowGameDVR "
$PathToLMPoliciesCortana = " HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search "
$PathToLMPoliciesGameDVR = " HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR "
$PathToLMPoliciesSystem = " HKLM:\SOFTWARE\Policies\Microsoft\Windows\System "
$PathToCUClipboard = " HKCU:\Software\Microsoft\Clipboard "
$PathToCUOnlineSpeech = " HKCU:\SOFTWARE\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy "
$PathToCUThemes = " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize "
@ -347,7 +348,7 @@ function Enable-WSearchService() {
function Disable-XboxGameBarDVRandMode ( ) {
# Adapted from: https://docs.microsoft.com/en-us/answers/questions/241800/completely-disable-and-remove-xbox-apps-and-relate.html
Write-Status -Types " - " , " Performance " -Status " Disabling Xbox Game Bar DVR... "
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\PolicyManager\default\ApplicationManagement\Allow GameDVR" -Name " value " -Type DWord -Value 0
Set-ItemProperty -Path " $PathToLMPoliciesApp GameDVR" -Name " value " -Type DWord -Value 0
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR " -Name " AppCaptureEnabled " -Type DWord -Value 0
Set-ItemProperty -Path " HKCU:\System\GameConfigStore " -Name " GameDVR_Enabled " -Type DWord -Value 0
If ( ! ( Test-Path " $PathToLMPoliciesGameDVR " ) ) {
@ -373,7 +374,9 @@ function Disable-XboxGameBarDVRandMode() {
function Enable-XboxGameBarDVRandMode ( ) {
Write-Status -Types " * " , " Performance " -Status " Enabling Xbox Game Bar DVR... "
Write-Status -Types " * " , " Performance " -Status " Removing GameDVR policies... "
Remove-Item -Path " HKLM:\SOFTWARE\Microsoft\PolicyManager\default\ApplicationManagement\AllowGameDVR " -Recurse
If ( ( Test-Path " $PathToLMPoliciesAppGameDVR " ) ) {
Remove-Item -Path " $PathToLMPoliciesAppGameDVR " -Recurse
}
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR " -Name " AppCaptureEnabled " -Type DWord -Value 1
Set-ItemProperty -Path " HKCU:\System\GameConfigStore " -Name " GameDVR_Enabled " -Type DWord -Value 1
If ( ! ( Test-Path " $PathToLMPoliciesGameDVR " ) ) {
@ -395,5 +398,4 @@ function Enable-XboxGameBarDVRandMode() {
Grant-RegistryPermission -Key " HKLM:\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.GameBar.PresenceServer.Internal.PresenceWriter "
Write-Status -Types " * " , " Performance " -Status " Enabling GameBar Presence Writer... "
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.GameBar.PresenceServer.Internal.PresenceWriter " -Name " ActivationType " -Type DWord -Value 1
}