OpenSubKey() in Windows 11

34 views Asked by At

once upon a time I used this snippet of code to open a registry key.

$Path='SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall' 
$Key='Autodesk Revit 2019'
$localMachineHive = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, 0)
$localMachineHive.OpenSubKey("$Path\$Key")

That was in Windows 10, and I am pretty sure early builds of Windows 11. I am now trying it again with a current build of Windows 11, and getting nothing. Has something changed, or am I missing something? I have tried various UAC levels, and that doesn't seem to affect anything.

0

There are 0 answers