Open thomasmaurer opened 7 years ago
like this? :)
function Find-ContainerImage{
Param(
[Parameter(
Position = 0,
Mandatory=$false,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[string]$ContainerName = "microsoft/*"
)
$i = 1
$FoundContainer = docker search --format "{{.Name}}" $ContainerName
$FoundContainer | %{
"$i. $_"
$i++
}
IF ($FoundContainer.count -gt 1){
$Select = Read-Host "Please make a selection"
return $FoundContainer[$($Select-1)]
}ELSE{
return $FoundContainer[0]
}
}
Find-ContainerImage 'microsoft/mssql'
Output of
$PSVersionTable
(from a powershell process): Name ValuePSVersion 5.1.15063.296 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.15063.296 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 (paste your output here)
0.1.0.111