ps/Modules/Alkami.PowerShell.ServiceFabric/Public/Get-AlkamiServiceFabricNode.ps1
2023-05-30 22:51:22 -07:00

24 lines
770 B
PowerShell

function Get-AlkamiServiceFabricNode {
<#
.SYNOPSIS
Returns the nodes of the connected Service Fabric cluster.
.PARAMETER EnvironmentName
Filters the results to the node types of a given environment name.
#>
[CmdletBinding()]
Param(
[Parameter(Mandatory = $false)]
[string]$EnvironmentName = $null
)
# Get the available nodes from Service Fabric
$results = Get-ServiceFabricNode;
# Filter results by the nodes of a particular environment, if provided.
if(![string]::IsNullOrWhiteSpace($EnvironmentName)) {
$workerNodeType = Format-AlkamiEnvironmentWorkerNodeType -environmentName $EnvironmentName;
$results = $results | Where-Object { $_.NodeType -eq $workerNodeType}
}
return $results;
}