Windows 10: is there any way to disable tamper protection using the command line?

I work with many test PCs, so I want to automate the procedure to install the operating system and configure it.

Disabling antivirus is one of the configuration steps. To do it, I used to

reg add "HKLMsoftwarepoliciesmicrosoftwindows defender" /v DisableAntiSpyware /t REG_DWORD /d 1 /f

It worked fine for a while, but now it does not work and displays the error message "Access denied."

After searching for a long time, I discovered that "tamper protection" blocks attempts to modify the windefend configuration through the registry.

You cannot disable Windows Defender using group policy and registration

I know how to disable "tamper protection" using the GUI, but for automation, I should do this with the CLI.

I tried to modify the registry for "tamper protection" through regedit, but it seems that "tamper protection" blocks the attempt to modify it.

Is there any way to disable "tamper protection" using the command line?