I have the following powershell script
    Set-ItemProperty "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender" -Name DisableAntiSpyware -Value 0x00000001
    New-Item -Path "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows" -name WindowsUpdate
    New-Item -Path "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"-Name AU
    Set-ItemProperty "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name NoAutoUpdate -Value 0x00000000
    Set-ItemProperty "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name AUOptions -Value 0x00000002
Basically, it turns off Windows Defender and stops Microsoft from auto-updating my computer. I restarted by computer and when I checked the Windows Defender/Update settings via gpedit, the changes I made via registry are not reflected.
As a test, I tried:
  1. Deleting the entries I made.
  2. Configure Windows Defender/Update via gpedit.
  3. Export Windows Defender/Update registry setting.
  4. Change Windows Defender/Update to an unconfigured state.
  5. Close gpedit.
  6. Import registry setting from step3.
  7. Open gpedit again and check Windows Defender/Update. Both components are still in unconfigured state.

As another test, I also tried:
  1. Configuring Windows Defender/Update via gpedit.
  2. Delete Windows Defender/Update registry setting.
  3. Open gpedit again and check Windows Defender. Both components are still configured.

Any ideas what I could be doing wrong? Thanks