If you just want to disable ClickOnce in Edge, I think this line is enough:
$RegistryPath = 'HKLM:\Software\Policies\Microsoft\Edge'
$Name = 'ClickOnceEnabled'
$Value = 0
# Create the key if it does not exist
If (-NOT (Test-Path $RegistryPath)) {
New-Item -Path $RegistryPath -Force | Out-Null
}
Set-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -Type DWORD -Force
It edits the registry which has the same effect with this policy: https://learn.microsoft.com/en-us/deployedge/microsoft-edge-policies#clickonceenabled. After running the script, you could open this page edge://policy in Edge to check if the policy has been applied. If it's applied successfully, you'll find this policy on that page:
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Regards,
Yu Zhou