I am making a small script for uninstalling the 7 Zip software from my servers, for that I have to find the 7 Zip software and un-install using the script.
On some windows servers I am able to find the software however on many of them I am unable to find them although they are installed as I can see it from the appwiz.cpl.
I cannot use Get-ItemProperty
remotely, as WinRM is not configured correctly in the environment. So being too lazy I am trying create a powershell script to find the 7 Zip software and uninstall it.
$servers= Get-Content "C:\Server.txt"
Foreach($server in $servers)
{
$ZipSoft= get-wmiobject win32_Product | where {$_.Name -like "*7-Zip*"}
$ZipSoft.Uninstall()
}
I have tried to find individually on those servers however it does not gives me the output even no errors, other installed software I can find using the above. Any idea about this why I am not able to find it on those servers?