Use PowerShell to change Registry values

In this article, we’ll see how to modify the registry using two well-known PowerShell cmdlets. The first cmdlet is New-Item while the second is Set-ItemProperty. You can use either of these cmdlets to modify an existing registry key or add a new registry value.

1] Modify registry using New-Item PowerShell cmdlet

In this example, I’ll be creating AllowIndexingEncryptedStoresOrItems registry DWORD at Usually, this registry DWORD is created to allow Windows 10 to index encrypted files. The Windows Search registry key doesn’t exist by default. So I’ll be creating that first, and then I’ll create the registry DWORD and set it to 1. You can replace the registry key location and values in your case. Here are the steps involved. Open Windows PowerShell as an Administrator.   Type following and press Enter key to go to registry location: Then execute the following cmdlet to create the new registry sub-key named Windows Search. I’m using -Force parameter here to override if the registry items exist already. Now as the registry sub-key is created, I’ll now create registry DWORD and execute the following code for this:  Note: If you’re creating string, you have to use the -PropertyType as a string. You can execute pop-location to go back to normal PowerShell where you can execute other cmdlets.

2] Modify registry using Set-ItemProperty PowerShell cmdlet

For this example, I’ll be setting HideSCAVolume registry DWORD at Setting this DWORD to 0 restores the Volume icon if it is missing from the taskbar. Here are the steps for this: Open Windows PowerShell (Admin). Then simply copy-paste this cmdlet to perform registry manipulation. Of course, you need to modify the registry location and value with your own, in the below-mentioned code: With this method, you don’t need to execute pop-location to go back to normal PowerShell as the registry change is directly made here. I trust this guide helps you modify the registry using Windows Powershell. You can also take a look at how to use PowerShell to restart a remote Windows computer.  

Use PowerShell to modify or change Registry values - 6