I am looking for a Batch or PowerShell script to download the latest artifacts from Jfrog Artifactory repository.
I have written following shell scripts which works absolutely fine on a Linux machine.
Script:
ArtifactUrl=`curl -u **artifactoryusername**:**artifactorypassword** --silent https://artifactorydomain/artifactory/api/storage/repositoryname/?lastModified | grep uri | awk '{ print $3 }' | sed s/\"//g | sed s/,//g`
echo $ArtifactUrl
downloadartifactUrl=`curl -u **artifactoryusername**:**artifactorypassword** --silent $ArtifactUrl| grep downloadUri | awk '{ print $3 }' | sed s/\"//g | sed s/,//g`
echo $downloadartifactUrl
curl -u **artifactoryusername**:**artifactorypassword** -O $downloadartifactUrl
echo "Downloading Latest Artifact"
But now we got a new requirement to download the artifacts on a Windows agent and we can't install CURL over there. So we need to either use Batch or PowerShell to download the artifacts.
Please let me know if you have got any sample scripts.