Creating Registry Keys with Powershell


I am trying to check if a key-structure exists in the registry using powershell. If the structure does not exist, I need to create it and then I need to create the keys in the ending folder. If I run the snippets individually to create the keys, they create just fine. But running the block itself (ensuring manually within the registry that the keys don’t exist) it won’t create the folder structure. Not sure what the issue is. Any help would be appreciate. The code is as follows:


Here is how I’d do it.


Creating Registry Keys with Powershell by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply