24 lines
732 B
PowerShell
24 lines
732 B
PowerShell
|
function Test-RadiumService {
|
|||
|
<#
|
|||
|
.SYNOPSIS
|
|||
|
Tests an array of machines looking for instances of the radium service
|
|||
|
|
|||
|
.PARAMETER MachineNames
|
|||
|
An array of machines to test against. These machines should be a single pod grouping.
|
|||
|
#>
|
|||
|
param (
|
|||
|
[array]$MachineNames
|
|||
|
)
|
|||
|
$services = Get-Service -ComputerName $MachineNames -Name 'Alkami Radium Scheduler Service' | Select-Object MachineName, Status
|
|||
|
|
|||
|
[array]$runningServices = $services | Where-Object { $_.Status -eq "Running"}
|
|||
|
|
|||
|
$runningServices | ForEach-Object { Write-Host $_.MachineName "is running radium" }
|
|||
|
|
|||
|
if ($runningServices.Count -eq 0) {
|
|||
|
throw "There are no servers running radium!"
|
|||
|
}
|
|||
|
Write-Host "Radium is running successfully"
|
|||
|
}
|
|||
|
|