title: How to create a number of directories with consecutive names in powershell?
body: <p>I'm coding a script that runs an executable, and everytime the executable runs properly, it has to create a directory and an output file, and then move the file inside the directory. The problem comes with the names of the directories. I pass the name as an argument to the script, but the names aren't the ones I want to be, here's the code:</p>
  
  <pre><code>IF ($args.Count -eq 2 -or $args.Count -eq 3) {
      $c = 0
      $i = 0
      $cont = 1
      do {
          ./simula.exe $cont RES
          IF ($? -ne 0) {
              $c = $c +1;
              New-Item $args$c -ItemType directory
              Move-Item RES $args$c
          }
          ELSE {
              $i = $i +1;
          }
          $cont = $cont +1;
  }
  while ($c -le $args[1])
      $c = $c -1;
      "Shan generat $c simulacions correctes."
      "Hi ha hagut $i simulacions erronies."
  }   
  ELSE {
      "Nombre de parametres incorrecte"
  }
  </code></pre>
  
  <p>If I run it like this: <code>.\treball DIREC 10</code> it should create 11 folders with the name DIREC1, DIREC2, ... DIREC11 and place 1 file named RES inside each directory. However the names of the directories it creates are: DIREC101, DIREC102, ... DIREC1011.
  I've been touching some things in the New-Item line but I can't get to the names I need. How can I do it?</p>