title: How to create multiple subfolders?
body: <p>How do I create a folder structure where I have one root folder, then approximately 9 differently named subfolders; within these subfolders there another set of differently named subfolders.  I have already made one .csv file with the script.  But I do not feel like writing out 30 lines of the same code to make these subfolders.</p>
  
  <p>Here is what I have so far:</p>
  
  <pre class="lang-psh prettyprint-override"><code>$LogsDir = "D:\Logs"
  
  If (-Not (Test-Path $LogsDir)) {
      New-Item -Path $LogsDir -ItemType Directory | Out-Null
  } Else {
      Write-Host "Directory already exists!"
  }
  
  $Subfolders1 = Import-Csv "Subfolders1.csv";
  
  $Subfolders1 | Where-Object {$_.Type -eq 'Subfolder'} |
      ForEach-Object {
          $Subfolders1 = $_.Name;
          New-Item "$LogsDir\$Subfolders1" -ItemType Directory
      }
  
  # ******sbf1 = the first set of subfolders******
  # ******sf-** = the second set******
  
  New-Item -Path "$LogsDir\sbf1\sf-a1" -ItemType Directory
  New-Item -Path "$LogsDir\sbf1\sf-a2" -ItemType Directory
  New-Item -Path "$LogsDir\sbf1\sf-a3" -ItemType Directory
  New-Item -Path "$LogsDir\sbf2\sf-a1" -ItemType Directory
  New-Item -Path "$LogsDir\sbf2\sf-a2" -ItemType Directory
  New-Item -Path "$LogsDir\sbf2\sf-b2" -ItemType Directory
  </code></pre>
  
  <p>I am trying to create a log file folder tree.  I think I got some of it down but any help would appreciated.</p>