Skip to content

Instantly share code, notes, and snippets.

@thedavecarroll
Created May 27, 2019 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thedavecarroll/9533092676174b2721a06daf5b409f2b to your computer and use it in GitHub Desktop.
Save thedavecarroll/9533092676174b2721a06daf5b409f2b to your computer and use it in GitHub Desktop.
Update Docker Images
$DockerImages = @{
Path = 'function:global:Update-DockerImages'
Value = {
try {
Invoke-Expression -Command 'docker images --format "{{.Repository}}" | Where-Object {$_ -ne "<none>"} | Foreach-Object { docker pull $_ }'
}
catch {
Write-Error -ErrorRecord $_
}
}
}
New-Item @DockerImages | Out-Null
New-Alias -Name 'udi' -Value Update-DockerImages
@thedavecarroll
Copy link
Author

You can add this snippet to any of your PowerShell profiles to allow quick updates to all your docker images.

$PROFILE | Format-List *host,*hosts -Force

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment