I have a script that shuts the PcaSvc (Program Compatibility Assistant Service) before installing another program. However, I need a script to detect that it's Stopped so I can use it for SCCM AppModel detection.
I have this, but I'm getting erros......yes I'm a Powershell newbie......
$PcaSvc = Get-WmiObject win32_service | where Name -eq "PcaSvc"
if ($PcaSvc.State -eq "Stopped") {
$true
} else {
$false
}
Please assist...thanks!