Monday, 9 September 2013

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

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

I am having some odd trouble getting a REG_SZ value using:
(get-itemproperty -Path
"Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\VLC
media player" -Name UninstallString).UninstallString
(get-itemproperty -Path
"Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\VLC
media player" -Name UninstallString).UninstallString
get-itemproperty : Cannot find path
'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\VLC
media player' because it
does not exist.
At line:1 char:2
+ (get-itemproperty -Path
"Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows ...
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (HKEY_LOCAL_MACH...LC media
player:String) [Get-ItemProperty], ItemNotFoundException
+ FullyQualifiedErrorId :
PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand
This method works for another REG_SZ without issue, but when I call within
Uninstall it fails.
Specifically, it works with
(get-itemproperty -Path
"Registry::HKEY_CURRENT_USER\Software\Microsoft\Command Processor" -Name
autorun).AutoRun
Both data entries exist on my system.

No comments:

Post a Comment