24 lines
770 B
PowerShell
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;
|
|||
|
}
|