Updating your registry keys with powershell

How many times you have found yourself at the mercy of the regedit tool and messed up something because of it?
While regedit is a great for certain tasks, deploying your changes to a live environment with the help of regedit can send you to a world of hurt. One solution would be to use .reg files to add the keys you want to your registry database and this works fine in less complex changes for small deployments.
Another approach would be to leverage PowerShell commands to perform all the tedious work for you.
If you have more than a single change you can easily bundle them in an additional script.