block copilot from communicating with server

This commit is contained in:
zoicware
2025-10-06 22:06:04 -04:00
committed by GitHub
parent 8f002d86f6
commit 65eecfc3b3

View File

@@ -264,6 +264,27 @@ function Disable-Registry-Keys {
#delete the service #delete the service
sc.exe delete WSAIFabricSvc *>$null sc.exe delete WSAIFabricSvc *>$null
} }
#block copilot from communicating with server
if ($revert) {
if ((Test-Path "$backupPath\HKCR_Copilot.reg") -and (Test-Path "$backupPath\HKCU_Copilot.reg")) {
Reg.exe import "$backupPath\HKCR_Copilot.reg" *>$null
Reg.exe import "$backupPath\HKCU_Copilot.reg" *>$null
}
else {
Write-Status -msg "Unable to Find HKCR_Copilot.reg or HKCU_Copilot.reg in [$backupPath]" -errorOutput $true
}
}
else {
if ($backup) {
#backup .copilot file extension
Reg.exe export 'HKEY_CLASSES_ROOT\.copilot' "$backupPath\HKCR_Copilot.reg" >$null
Reg.exe export 'HKEY_CURRENT_USER\Software\Classes\.copilot' "$backupPath\HKCU_Copilot.reg" >$null
}
Write-Status -msg 'Removing .copilot File Extension...'
Reg.exe delete 'HKCU\Software\Classes\.copilot' /f *>$null
Reg.exe delete 'HKCR\.copilot' /f *>$null
}
#force policy changes #force policy changes
Write-Status -msg 'Applying Registry Changes...' Write-Status -msg 'Applying Registry Changes...'
gpupdate /force >$null gpupdate /force >$null