To check if a service started or not using PowerShell, you have to get the service object using Get-Service, then get its status using the Status property as below:
$ServiceName = "World Wide Web Publishing Service"
$ServiceStatus = (Get-Service -Name $ServiceName).status
if($ServiceStatus -eq "Running")
{
Write-Host "Running"
}
else {
Write-Host "Stopped"
}
Output

The Get-Service cmdlet gets objects that represent the services on a computer, including running and stopped services. Read more at Get-Service