I have some powershell script . Instead totalcmd* you can type another process you want.
$tc = get-process -Name totalcmd* | format-wide -property Name
echo $tc
if ($tc -eq "Totalcmd64")
{
Stop-Process -Name totalcmd*
}
Start-Sleep 10
It doesn't work, I think, because, my $tc not equal to string "totalcmd". How can I remove unwanted spaces of cmdlet get-process -Name totalcmd* | format-wide -property Name output and compare strings correctly?
$tcwill never equal a string object "Totalcmd64".