How to disable Copilot using PowerShell?

226 Views Asked by At

I am new to scripting/coding. My work has tasked me to get rid of or disable copilot from showing up and being utilized till we get all the greenlight from our state IT people to use it. This is what I have so far and I am running into errors that I can't seem to see.

-    # Create a new instance of the Windows Script Shell object
$objShell = New-Object -ComObject "WScript.Shell"

    # Modify registry key for Copilot eligibility
$RegPath1 = "HKCU\Software\Microsoft\Windows\Shell\Copilot\BingChat"
$objShell.RegWrite("$RegPath1\IsUserEligible", "0", "REG_DWORD")

Start-Sleep -10

    # Modify registry key to show Copilot button in Windows Explorer
$RegPath2 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
$objShell.RegWrite("$RegPath2\ShowCopilotButton", "1", "REG_DWORD")

It seems to work but I am getting an error message that I can't get PS to show. I have tried modifying the regedit but that option isn't available on my end for some reason. I have changed the start sleep to 10 instead of milliseconds 3000.

0

There are 0 best solutions below