@Simon Aebi Based on my research, if we run script in a 64-bit Powershell host on a 64-bit client architecture, we can set "Run script in 64-bit PowerShell host" as Yes:
Meanwhile, find an article mentioned to write registry keys in x64 hive and not WOW6432Node. We can read it for the reference.
Note: Non-Microsoft link, just for the reference.
Hope it can help.
If the response is helpful, please click "Accept Answer" and upvote it.
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.