[Feature Request]: Expand ImageTemplate removal
Description
Once #1726 is merged, we should consider bumping up the image template removal a bit:
There is a similar logic for the DevOps Self-Hosted construct here.
There are 2 main differences compared to the implementation in #1726 (Remove-ImageTemplate.ps1):
- The script filters for image template not in status new or running
- The script filters all found image template essentially for the prefix. Main reason being - If I run the script multiple times, or something about the pipeline fails or anything, the full image template name will be lost.
Agree, and I suggest to leverage the new namePrefix output of the image template module for the second point
With the current logic the template is removed - but only if nothing goes wrong. And as the name is different on every run you'd need to update stuff manually
Moved back to needs triage to suggest its closure given this won't be relevant with the new dependencies approach.