title: configuration CI/CD pipeline on Azure with Powershell Script
body: <p>I'm doing configuration CI/CD pipeline to publish SSRS and PowerBI reports to Azure with using Powershell on stages. I'm stuck on how to write code to get changed files on the branch, from there change the connection string to the database and then publish to dev workspace. I got complicated and confuses on the first step that get changed files from pull request approved. I try usinng git to get the changed files, but it seem i wrong. please help me find the ways to solve it. The code below:</p>
  <pre><code># Write your PowerShell commands here.
  
  Write-Host &quot;Hello World&quot;
  $Path = $env:AGENT_BUILDDIRECTORY
  $PBIX = Get-ChildItem -Path $Path -Recurse -Force | where {$_.Extension -eq &quot;.pbix&quot;} 
  foreach ($File in $PBIX )
  {
     Write-Host &quot;File changed: $($File.BaseName)&quot;
  }
  $files= $(git diff --name-only HEAD HEAD~2)
      Write-Host &quot;Found $($files) changed files&quot;
  
  </code></pre>
  <p>The reuslts:</p>
  <pre><code>-all name files printed.
  could not access HEAD
  PowerShell exited with code '1'.
  </code></pre>