title: Azure pipeline powershell script returns incorrect result
body: <p>I have the following tasks in an azure pipeline:</p>
  <pre><code>      - task: PowerShell@2
          displayName: Identiying the version fro the .csproj file
          inputs:
            targetType: &quot;inline&quot;
            script: |
              $xml = [Xml] (Get-Content ./src/MyProject/MyProject.csproj)
              $version = $xml.Project.PropertyGroup.Version
              echo $version
              echo &quot;##vso[task.setvariable variable=version]$version&quot;
  
        - task: PowerShell@2
          displayName: Checking if the git tag with current version already
          inputs:
            targetType: &quot;inline&quot;
            script: |
              $ver=git tag -l $(version)                
              Write-Host &quot;Project file version is $(version)&quot;
              Write-Host &quot;Received from git tag $ver&quot;
              if ($(version) -eq $ver) {
                      Write-Error &quot;Tag $(version) already exists&quot; 
                  }
              else {
                Write-Host &quot;Tag does not exist&quot;
                }
  </code></pre>
  <p>It basically pulls the version from the csproj file, create a pipeline parameter and then calls <code>git tag -l </code> to check if that version already exists as tag.
  The problem here is that the versions we extract from the .csproj file and the git are the same, yet the if command is not evaluated but rather else is executed.
  This is the output log of the azure pipeline:</p>
  <pre><code>&quot;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe&quot; -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command &quot;. 'D:\a\_temp\e1cb6bb9-fbd4-4282-a4cc-e74f89ac7660.ps1'&quot;
  Project file version is 0.2.5
  Received from git tag 0.2.5
  Tag does not exist
  </code></pre>
  <p>Why does this happen since they are equal? The result should be <code>Tag 0.2.5 already exists</code></p>