ps/Modules/Cole.PowerShell.Developer/Public/Get-ServersByPod.ps1
2023-05-30 22:51:22 -07:00

25 lines
941 B
PowerShell

function Get-ServersByPod {
param (
[Parameter(Mandatory = $false)]
[Alias('Environment')]
[ValidateScript({Assert-ValidAWSProfileName -ProfileName $_ -ArgumentValidationScript})]
$ProfileName = (Get-LocalCachedAWSProfile),
[Parameter(Mandatory = $true)]
[ArgumentCompleter( {
param ( $commandName,
$parameterName,
$wordToComplete,
$commandAst,
$fakeBoundParameters )
$p = $fakeBoundParameters.ProfileName
if ([string]::IsNullOrWhiteSpace($p)) {
$p = (Get-LocalCachedAWSProfile)
}
$s = Get-CachedInstances -ProfileName $p
return $s.Designation | Sort-Object | Get-Unique
} )]
[string]$Designation
)
return (Get-CachedInstances -ProfileName $ProfileName).Where({$_.Designation -eq $Designation})
}