Thank you for this. I didn't know it was even possible.
It didn't work, possibly because RunWait doesn't seem to use parameters. So I tried:
RunWait(@ComSpec & " /C " & $vDosTmp & ' ~ ARM64VERYSTRICTEXECUTION', $temp, @SW_MINIMIZE)
But that didn't work either.
The least bad thing I can think of is to write the registry entry and then delete it after running the command, in order not to clutter up the registry, but your method would be better if I could figure out how to make it work.
EDIT: As far as I can tell from online sources, the command-line parameter won't have any effect. The only way to make this work seems to be through the Registry. Of course I could be wrong about this, and any information will be welcome.