title: Copy section from one INI file to another INI file
body: <p>I have two .ini files (ABC.ini and ABC1.ini) and ABC.ini will always be up to date. The ABC1.ini should have few sections similar to the first ini file so that this file will also be up to date. Now I want to know how can I copy the specific sections from one file to another. My sections will be like,
  <code>[LINK.Server1....n.Mappings]</code>
  <code>[LINK.Server1.....n]</code>
  <code>[LINK.User(1.....n]</code></p>
  
  <p>I need to copy these sections from ABC.ini to ABC1.ini and these sections might exist in ABC1.ini file already so I would need to delete the existing content in ABC1.ini and replace the new content from ABC.in</p>
  
  <p>Could you all please advise if this can be achieved using powershell/java. Any sample will help.</p>
  
  <p>What I have done till now.</p>
  
  <pre><code>Write-Host "Reading parameters from 'parameters.ini' file...";
  Get-Content "parameters.ini" | ForEach-Object -Begin {$settings=@{}} -Process {$store = [regex]::split($_,'='); if(($store[0].CompareTo("") -ne 0) -and ($store[0].StartsWith("[") -ne $True) -and ($store[0].StartsWith("#") -ne $True)) {$settings.Add($store[0], $store[1])}}
  
  
  $Param1 = $settings.Get_Item("Param1")
  $Param2 = $settings.Get_Item("Param2")
  $Param3 = $settings.Get_Item("Param3")
  
  # Displaying the parameters
  Write-Host "Param1 value is: $Param1";
  Write-Host "Param2 value is: $Param2";
  Write-Host "Param3 value is: $Param3`n";
  </code></pre>
  
  <p>Thanks!</p>