I\'m trying to learn powershell and tried to construct a if else statement:
if ((Get-Process | Select-Object name) -eq \"svchost\") { Write-Host \"seen\"
You can simply ask Get-Process to get the process you're after:
if (Get-Process -Name svchost -ErrorAction SilentlyContinue) { Write-Host "seen" } else { Write-Host "not seen" }