title: How to push build artifacts to Git repository using PowerShell script during Azure DevOps build?
body: <p>I am new to Azure DevOps and learning and want to push a file from builds artifact directory to git repository. I am using this inline PowerShell script to do so:</p>
  
  <pre><code>Write-Host "Hello World"
  write-host " Staging directory "$(build.artifactstagingdirectory)
  git config --global user.email &lt;useremail&gt;
  git config --global user.name &lt;username&gt;
  git status
  $CurrentPath = Get-Location
  write-host "current path" $CurrentPath
  $PackagePath =new-item -type directory $(get-date -f MM-dd-yyyy_HH_mm_ss)
  $PackageZipPath = "$(build.artifactstagingdirectory)\&lt;artifact to be copied&gt;"
  Copy-Item $PackageZipPath -Destination $PackagePath 
  git add .
  git commit -m "Adding file"
  git push origin master
  git status
  write-host "Package Uploaded to GitHub"
  </code></pre>
  
  <p>But I am getting this error and not able to push the file in repo:</p>
  
  <pre><code>fatal: could not read Password for 'https://&lt;username&gt;@dev.azure.com': terminal prompts disabled
  </code></pre>
  
  <p>Am I missing the obvious? How should I use PAT/Password to authenticate?</p>