I have the following problem:
I try to get all uninstallable applications from the registry and use (gp 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*').DisplayName -Like '*'
as command.
In the x86 version of Powershell it returns a list of the applications but in the x64 version I get this error:
PS C:\Users\simon> (gp 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*').DisplayName -Like '*'
gp : Die angegebene Umwandlung ist ungültig.
In Zeile:1 Zeichen:2
+ (gp 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*').Di ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-ItemProperty], InvalidCastException
+ FullyQualifiedErrorId : System.InvalidCastException,Microsoft.PowerShell.Commands.GetItemPropertyCommand
The gp
command itself seems to work. Also the command above works in x64 Powershell on other systems.
What I've tried:
gp
to verify the Powershell knows this command.[intPtr]::size
to check if its x86/x64- Reinstalled Powershell (via
optionalfeatures.exe
) - Installed a new .NET framework
- Tried the commands on other systems (they work)
- Run Powershell as admin
- Changed the
path
(as env variable) for Powershell.exe (to use x86 as default, but this lead to other problems - nevermind)
I am out of ideas and also Google didn't get me further.
[SOLUTION]
I found out this error was caused by an invalid REG_DWORD
-value for the property NoModify
of a NetBeans installation in the registry.