agentName = "Malware Agent V2"; $agent = get-transportagent -Identity:$agentName; if ($agent) { uninstall-transportagent ...