When using Windows 10 the Game Bar window is posted to the screen possibly when press Windows+G or just letter G in other applications
To disable the Game Bar feature you will need to make the following registry changes.
Location:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR
Value name: AllowgameDVR
Value type: DWORD (32-bit)
Value data: 0
Location:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR
Value name: AppCaptureEnabled
Value type: DWORD (32-bit)
Value data: 0
Location:
HKEY_CURRENT_USER\System\GameConfigStore
Value name: GameDVR_Enabled
Value type: DWORD (32-bit)
Value data: 0
After making the above changes restart the PC.
Now open Powershell as administrator and use the below command to remove the Xbox app from Windows 10:
Get-AppxPackage *xboxapp* | Remove-AppxPackage