Skip to content
This repository has been archived by the owner on Apr 28, 2018. It is now read-only.

We need a Find-ContainerImage for docker search #183

Open
thomasmaurer opened this issue Jun 1, 2017 · 1 comment
Open

We need a Find-ContainerImage for docker search #183

thomasmaurer opened this issue Jun 1, 2017 · 1 comment

Comments

@thomasmaurer
Copy link

Output of $PSVersionTable (from a powershell process):
Name Value


PSVersion 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)


**Output of `ipmo Docker; (module Docker).Version.ToString()` (from a powershell process):**

0.1.0.111


**Steps to reproduce the issue:**
1. Open PowerShell
2. try to use find-containerimage
3.


**What actually happened?:**
Nothing ;-)

**What did you expect to happen?:**
search the default registry like docker search

**Additional information:**
@JohnCroix
Copy link

JohnCroix commented Dec 9, 2017

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'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants