Skip to content

Instantly share code, notes, and snippets.

View hughesjj's full-sized avatar

James Hughes (Splunk) hughesjj

  • Splunk
  • Seattle, WA
View GitHub Profile
@hughesjj
hughesjj / Find-OrphanDockerLayers.ps1
Created December 16, 2022 07:41 — forked from olljanat/Find-OrphanDockerLayers.ps1
Find Windows containers orphan layers
param (
[switch]$RenameOrphanLayers
)
If ($RenameOrphanLayers) {
Write-Warning "$($env:COMPUTERNAME) -RenameOrphanLayers option enabled, will rename all orphan layers"
}
# Get known layers on Docker images
[array]$ImageDetails += docker images -q | ForEach { docker inspect $_ | ConvertFrom-Json }