title: how to create monthly folder from 2020 to 2024 in powershell
body: <p>I need to auto create monthly folder from 2020 to 2024.</p>
  <p>For instance,</p>
  <ul>
  <li><p>2020</p>
  <pre><code> -Jan
   -Feb
    ...
   -Dec
  </code></pre>
  </li>
  <li><p>2021</p>
  <pre><code> -Jan
    ...
   -Dec
  </code></pre>
  </li>
  <li><p>2022</p>
  <pre><code> -Jan
   ...
   -Dec
  </code></pre>
  </li>
  </ul>
  <p>all the way to 2024.</p>
  <p>I have tried with my code -</p>
  <pre><code>$d = 1..12|%{(get-date).AddMonths(-6+$_).ToString(&quot;MMM yyyy&quot;)} 
  $d | % {(new-Item -Path C:\testmonth\$_ -ItemType Directory)}
  </code></pre>
  <p>I want to know is there a better coding to auto create monthly folder.</p>
  <p>Much appreciated folks</p>