I am trying to figure out how to uninstall software on remote machines. I've played around with this code below, I've tried -eq -match -like etc.....and it either fails or I get this output.
The software never gets uninstalled.
Invoke-Command-ComputerName"PCTEST4"-ScriptBlock {
$app=Get-WmiObject Win32_Product | where { $_.name-like"*Snagit 9.1.3*" }
$app.Uninstall()
}
PSComputerName : PCTEST4
RunspaceId : e81ca182-f6ac-42f4-a4d1-7078fb7455c9
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
ReturnValue : 1603