Helper/Check-MMAgent.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<#�
        .SYNOPSIS�
        Helper�function�to check if HealthService (MMAgent) is installed
#>

Function Check-MMAgent
{
    Try
    {
        If((Get-Service -Name 'HealthService' -ErrorAction SilentlyContinue))
        {
            $true
        }
        Else
        {
            $false
        }
    }
    Catch
    {
        Write-Warning -Message 'Install SCOM agent!'
    }
}