Azure Container Registry - delete all images except 2
问题 I want to delete all images in Azure Container Registry except the last two. I was looking for an script for do so but I only find to delete images older than X days. This is not possible for my situation because some days there are a lot of images created and other days only one. Somebody has any idea? 回答1: I am unable to test it right now but this little PowerShell script should work: $acrName = 'YourACRName' $repo = az acr repository list --name $acrName $repo | Convertfrom-json | Foreach