Powershell for creating folders and subfolders from csv
<p>I try to prepare a script that will create folders and subfolders from CSV.</p>

<p>When I create a CSV with 1 column 'Name' like so</p>

<pre><code>Name
XYZ
ZXX
FFF
</code></pre>

<p>with the following script I can achieve creation of folders</p>

<pre><code>$folder = "D:\Test\"
$name = Import-Csv D:\Test\Test.csv
Foreach ($line in $name)
{
    New-Item -path $folder -Name $line.Name -Type Directory
}
</code></pre>

<p>What I would like to achieve is to have CSV like this</p>

<pre><code>Name;Letter 
XYZ;A
ZXX;B
FFF;B
</code></pre>

<p>I want that the script creates folder $Folder\Letter\Name (so the final path is D:Test\A\XYZ; D:Test\B\ZXX; D:Test\B\FFF). Any advice is welcomed.</p>

<p>Thanks a lot.</p>