ps/Modules/Alkami.PowerShell.Services/Public/Test-RadiumService.ps1

24 lines
732 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
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"
}