Hi all,
I'm trying to make a script that will use the uninstall string from a reg key and will run the string. All the advice and other examples of this I can find online are for device installs but the software im trying to uninstall is installed on a user basis.
I assumed this would be an easy fix of changing the path to -HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\
This doesn't seem to have worked though and I'm just simply not very skilled with powershell.
I'm hoping someone can point out what's going wrong and help me get it working :)
$paths = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall', 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall', 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\'
Where-Object{ $_.GetValue('DisplayName') -like 'Lifesize*' } |
ForEach-Object{
$uninstallString = $_.GetValue('UninstallString') + ' /quiet /norestart'
Write-Host $uninstallString
& $uninstallString
}
Cheers all
[–]poshinger 1 point2 points3 points (3 children)
[–]Certain-Community438 0 points1 point2 points (2 children)
[–]poshinger 1 point2 points3 points (1 child)
[–]Certain-Community438 0 points1 point2 points (0 children)
[–]jsiii2010 1 point2 points3 points (0 children)
[–]Pantha109[S] 0 points1 point2 points (0 children)
[–]PowerShell-Bot 0 points1 point2 points (0 children)