Public/func_Get-SSHServer.ps1
function Get-SSHServer { [CmdletBinding()] param ( [Parameter(Position = 0, Mandatory = $false)][string]$Tag, [Parameter(Position = 1, Mandatory = $false)][string]$Name, [Parameter(Position = 2, Mandatory = $false)][Switch]$IP ) [Collections.Generic.List[SSHServer]]$sshServers = Get-SSHServersFile $result = $sshServers if(![string]::IsNullOrWhiteSpace($Tag)) { $result = $result | Where-Object Tags -Contains $Tag } if(![string]::IsNullOrWhiteSpace($Name)) { $result = $result | Where-Object Name -Like $Name } if($IP.IsPresent) { $result = $($result.IP) } return $result } |