Is it possible to list & delete the SNAPSHOT SUB versions from Azure feed,
from the below command we can get the complete list
@ReposList = curl -u username\@abc.com:key -X GET "https://feeds.dev.azure.com/abc/ProjectName/_apis/packaging/Feeds/FeedName/packages&$top=5000&includeAllVersions=true?api-version=5.1-preview.1";
But instead of complete list we need to print only SNAPSHOT and their sub versions
example, we need to print following list, & from here we need to delete last 2 versions.
MyApp-0.0.1-20210416.144147-3-sources.jar
MyApp-0.0.1-20210416.144147-3-sources.jar.sha256
MyApp-0.0.1-20210416.144147-3-sources.jar.sha512
MyApp-0.0.1-20210416.144147-3.pom
MyApp-0.0.1-20210416.144147-3.pom.sha256
MyApp-0.0.1-20210416.144147-3.pom.sha512
MyApp-0.0.1-20210416.144147-3.war
MyApp-0.0.1-20210416.144147-3.war.sha256
MyApp-0.0.1-20210416.144147-3.war.sha512
MyApp-0.0.1-20210416.141243-2-sources.jar
MyApp-0.0.1-20210416.141243-2-sources.jar.sha256
MyApp-0.0.1-20210416.141243-2-sources.jar.sha512
MyApp-0.0.1-20210416.141243-2.pom
MyApp-0.0.1-20210416.141243-2.pom.sha256
MyApp-0.0.1-20210416.141243-2.pom.sha512
MyApp-0.0.1-20210416.141243-2.war
MyApp-0.0.1-20210416.141243-2.war.sha256
MyApp-0.0.1-20210416.141243-2.war.sha512
MyApp-0.0.1-20210416.080021-1-sources.jar
MyApp-0.0.1-20210416.080021-1-sources.jar.sha256
MyApp-0.0.1-20210416.080021-1-sources.jar.sha512
MyApp-0.0.1-20210416.080021-1.pom
MyApp-0.0.1-20210416.080021-1.pom.sha256
MyApp-0.0.1-20210416.080021-1.pom.sha512
MyApp-0.0.1-20210416.080021-1.war
MyApp-0.0.1-20210416.080021-1.war.sha256
MyApp-0.0.1-20210416.080021-1.war.sha512
We retain only the recent 25 snapshots of this artifact
And now from the above list, we need to delete last 2 or (n-1), so the list will be as :
MyApp-0.0.1-20210416.144147-3-sources.jar.sha256
MyApp-0.0.1-20210416.144147-3-sources.jar.sha512
MyApp-0.0.1-20210416.144147-3.pom
MyApp-0.0.1-20210416.144147-3.pom.sha256
MyApp-0.0.1-20210416.144147-3.pom.sha512
MyApp-0.0.1-20210416.144147-3.war
MyApp-0.0.1-20210416.144147-3.war.sha256
MyApp-0.0.1-20210416.144147-3.war.sha512
Can some one help on this, please.