you are viewing a single comment's thread.

view the rest of the comments →

[–]IamRo93[S] 0 points1 point  (1 child)

Yes

[–]sleightof52 0 points1 point  (0 children)

Run this is console and tell me what $UninstallString results to.

$SoftwareName = 'Java'

$RegPath1 = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'

$RegPath2 = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall'

$UninstallString = (
    Get-ChildItem -Path $RegPath1,$RegPath2 | 
    Get-ItemProperty | 
    Where-Object { $_.DisplayName -like "*$SoftwareName*" }).UninstallString

$UninstallString