get-itemproperty reporting item doesn't exist, when it does get-itemproperty reporting item doesn't exist, when it does powershell powershell

get-itemproperty reporting item doesn't exist, when it does


A forum thread lead me to the answer.

It discusses the virtualization of the registry for 32-bit and 64-bit programs.

In this case, since the key "is missing," additional paths must be checked (note that I should be checking for paths with test-path in a conditional before trying any "errorable" actions).

PS > (dir HKLM:\SOFTWARE\wow6432node\Microsoft\Windows\CurrentVersion\Uninstall | measure).count134PS > (dir hklm:\software\microsoft\windows\currentversion\uninstall | measure).count134

So, I must be running 32-bit powershell.exe.

PS > [Environment]::Is64BitProcessFalse 

Also, HKEY_CLASSES_ROOT\Installer\Products is another location that lists programs installed with the Windows Installer.

This answer is helpful in regards to 32-bit vs. 64-bit powershell.exe.

The solution to this problem is robust. I have modified the previously linked function a bit to make it more accessible.

P.S. I'm running Windows 7 on bootcamp on a macbook pro. Oddly, regardless of the powershell.exe I execute, it is 32-bit. I simply can not see the registry keys regardless of whether or not the location is beneath the wow6432node.