title: How to get variables from config file in powershell
body: <p>How can i get variables from a config file in XML ?</p>
  
  <p>I am actualy doing this using a .txt config file.</p>
  
  <p>There is my actual code : </p>
  
  <p>Config.txt</p>
  
  <pre><code>[Repertoire de SPO (generalement C:\SPO)]
  destinationn="C:\SPO"
  
  [Nom du sous repertoire de SPO (generalement : SPO1)]
  sous_destination="SPO1"
  
  [Numero de la version de SPO vers laquelle vous souhaitez upgrade (par exemple : 1812.4)]
  version="1812.4"
  
  [Nom du pool dapplication lie a SPO (par defaut SPO_ADV)]
  applicationPoolName="SPO_ADV"
  
  [Chemin de livraison de la nouvelle version de SPO (par defaut \\path\to\somewhere)]
  livraisonn="\\path\to\somewhere"
  </code></pre>
  
  <p>Powershell.ps1</p>
  
  <pre><code>Get-Content "$current_path\config.txt" | foreach-object -begin {$h=@{}} -process { $k = [regex]::split($_,'='); if(($k[0].CompareTo("") -ne 0) -and ($k[0].StartsWith("[") -ne $True)) { $h.Add($k[0], $k[1]) } }
  
  $destinationn = $h.Get_Item("destinationn")
  </code></pre>
  
  <p>I would like to do a similar thing using an .xml config file.</p>