• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Generate many XML files

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #11
    powershell

    here is a simple little powershell script to do something close to what you want.
    save it as .ps1 file and execute it or just paste the lot into a powershell console window.
    it will write the files to your current directory so make sure you have permission and also make sure you have set your execution policy.
    its easily changeable to add all the xml into you want

    Code:
    $array  = 1..100
    foreach ($element in $array){
    "<Tag1>Some XML</Tag1>`r`n<Tag2>More XML</Tag2>" |out-file "file_$element.xml"
    }

    Comment

    Working...
    X