Advertisement
Dennisaa

SpecFlowAppConfig01

Oct 10th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $xmlFile = "C:\temp\app.config"
  2. $xml = [xml] (Get-Content $xmlFile)
  3. $xml.SelectNodes('//configuration/specFlow') | % {
  4.     $stepAssembly1 = $xml.CreateNode('element','stepAssembly','')
  5.     $stepAssembly2 = $xml.CreateNode('element','stepAssembly','')
  6.     $stepAssembly1.SetAttribute('assembly','Dennis.Speech.Framework')
  7.     $stepAssembly2.SetAttribute('assembly','Dennis.Speech.Core')
  8.  
  9.     $stepAssemblies = $xml.CreateNode('element','stepAssemblies','')
  10.  
  11.     $stepAssemblies.AppendChild($stepAssembly1)
  12.     $stepAssemblies.AppendChild($stepAssembly2)
  13.  
  14.     $_.AppendChild($stepAssemblies)
  15. }
  16. $xml.Save($xmlFile)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement