Registry roots

DriveRoot
HKCU:\Registry::HKEY_CURRENT_USER\
HKLM:\Registry::HKEY_LOCAL_MACHINE\
HKCR:\¹⁾Registry::HKEY_CLASSES_ROOT\

¹⁾: provide HKCR: drive

New-PSDrive -PSProvider registry -Root HKEY_CLASSES_ROOT -Name HKCR

Modify keys

The registry consist out of nested keys and their entries.

List entries

$key = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion"
Get-ItemProperty -Path $key

Get entry

$key = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion"
Get-ItemProperty -Path $key -Name DevicePath

Write entry

$key = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion"
"test" | Set-ItemProperty -Path $key -Name DevicePath -Value $_

Sources:

Related:

Tags:
Windows