title: Backup and delete registry with PowerShell
body: <p>How to backup all the registry and delete specific registry values on a remote server in PowerShell?</p>
  
  <pre><code>$Registry = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $Computer)
  $RegistryKey = $Registry.opensubkey($RegistryPath,$true) ## $True = Write
  $RegistryKeyValue = $RegistryKey.getvalue($RegistryKeyName)
  
  $RegistryKey.DeleteValue("$RegistryKeyName") 
  Write-Output "Removed registry key ($RegistryKeyName) on $Computer  `r "
  </code></pre>
  
  <p>I have tried this but not working.</p>