title: How to download the latest Artifacts from Jfrog Artifactory on a Windows Machine
body: <p>I am looking for a Batch or  PowerShell script to download the latest artifacts from Jfrog Artifactory repository.</p>
  
  <p>I have written following shell scripts which works absolutely fine on a Linux machine.</p>
  
  <p>Script: </p>
  
  <pre><code>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"
  </code></pre>
  
  <p>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.</p>
  
  <p>Please let me know if you have got any sample scripts.</p>