I had to remove a registry value this morning to reverse a change I made last year, and instead of firing up the GUI to do so, I decided I’d make myself a New Year’s resolution on my first day back at work;
If you’re going to do something, try doing it in PowerShell first.
Here’s where the PowerShell registry provider doesn’t work as you’d expect. If you did a ‘dir’, ‘ls’, or Get-ChildItem, you wouldn’t see anything listed. The cmdlet you need to use is Get-ItemProperty, and then pass in the current path.
Get-ItemProperty -Path $pwd
($pwd is an automatic variable that holds the current path)
To remove the registry value, I did the following:
Remove-ItemProperty -Name ImportPRF -Path $pwd -WhatIf
Note: I always use the –whatif parameter first, to see what’s going to happen. Remove it once you’ve tested and are happy with the results of the command. Add –verbose for even more information.