ps/Modules/Alkami.PowerShell.Services/Public/Start-ServicesOnly.ps1
2023-05-30 22:51:22 -07:00

62 lines
2.4 KiB
PowerShell

function Start-ServicesOnly {
<#
.SYNOPSIS
Starts any stopped Alkami Windows services, both Chocolatey based and Legacy
.DESCRIPTION
Starts any stopped Alkami Windows services, both Chocolatey based and Legacy. Maximum parallelism can be controlled with the maxParallel parameter
.PARAMETER maxParallel
Can be an int value from 1 to [int]::MaxValue. Limits service start parallelism
.EXAMPLE
Start-ServicesOnly
[Get-ChocolateyServices] : Finding services installed out of the chocolatey path: C:\ProgramData\chocolatey
[Get-ChocolateyServices] : Found 4 chocolatey services.
[Get-ChocolateyServicesToStart] : Found 4 Chocolatey Services
[Start-ServicesChocolateyOnly] : Starting 2 Services in Tier 0
[Start-ServicesInParallel] : Starting Service Alkami.Services.Subscriptions.Host
[Start-ServicesInParallel] : Starting Service Alkami.MicroServices.Broker.Host
[Start-ServicesInParallel] : Done Starting Services
[Start-ServicesChocolateyOnly] : Tier 0 took 00:00:10.2552499 to start
[Start-ServicesChocolateyOnly] : Starting 1 Services in Tier 1
[Start-ServicesInParallel] : Starting Service Alkami.MicroServices.Authorization.Service.Host
[Start-ServicesInParallel] : Done Starting Services
[Start-ServicesChocolateyOnly] : Tier 1 took 00:00:14.4166193 to start
[Start-ServicesChocolateyOnly] : Starting 1 Services in Tier 2
[Start-ServicesInParallel] : Starting Service Alkami.MicroServices.Features.Beacon.Host
[Start-ServicesInParallel] : Done Starting Services
[Start-ServicesChocolateyOnly] : Tier 2 took 00:00:13.5352469 to start
[Start-ServicesChocolateyOnly] : Done starting services.
[Start-ServicesInParallel] : Starting Service Alkami Radium Scheduler Service
[Start-ServicesInParallel] : Starting Service Filebeat (Haystack)
[Start-ServicesInParallel] : Done Starting Services
#>
[CmdletBinding()]
[OutputType([void])]
Param(
[Parameter(Mandatory = $false)]
[ValidateRange(1, [int]::MaxValue)]
[int]$maxParallel = 10
)
$loglead = Get-LogLeadName
Start-ServicesChocolateyOnly -maxParallel $maxParallel
[array]$services = Get-ServicesToStart -SkipChocolateyServices
Start-FileBeatsService
if (Test-IsCollectionNullOrEmpty -Collection $services) {
Write-Warning "$logLead : No Legacy Services Found to Start"
return
}
Start-ServicesInParallel -ServiceNamestoStart $services -MaxParallel $maxParallel
}