title: Read Properties in Jenkins Pipeline and Pass Variable to Powershell
body: <p>I have a Jenkins Pipeline script which is intended to do the following steps</p>
  
  <ol>
  <li>Read a property file from another job in Jenkins</li>
  <li>Extract the variable from the Property file </li>
  <li>Use the variable and update a POM file using Powershell, so that other steps can be executed</li>
  </ol>
  
  <p>Reading of the file and echoing the variable is working fine, but the variable passed from the property file is not recognized by PowerShell script somehow as xml file node is remaining empty</p>
  
  <p>Below is the Pipeline script</p>
  
  <pre><code>pipeline  {
  
      agent { 
  
          label { 
      label'Test'
          customWorkspace "C:\\workspace"
      }
      }
  
   stages {
  
  stage('Checkout code') {
    steps {
      script {
       checkout .......
  
      }
  
    }
  }
  
  stage ('Pre Steps') {
  
   steps {
  
       script {
  
  
          copyRemoteArtifacts '........'
      properties = readProperties file :'test.properties
  
      echo "${properties.test_version}"
  
      powershell label: '', script: '''$pomPath = Resolve-Path .\\pom.xml
  
  $xml = New-Object System.Xml.XmlDocument 
  
  $xml.PreserveWhitespace = $true
  
  $xml.Load($pomPath)
  
  $xml.project.properties."testapplciation.version" ="${properties.test_version}"
  
  $xml.Save($pomPath)'''
  </code></pre>
  
  <p>Please, can someone help, what could be wrong here.</p>