PowerShell Create Multiple Folders: A Safe Step-by-Step Guide

Create several folders in PowerShell with one command, then check the results in File Explorer. Review the folder names and destination before you run it.

A large PowerShell logo appears over a dark background of command-line text.
In this article

PowerShell can create multiple folders with one New-Item command by giving it a directory type and a list of names. For example, New-Item -ItemType Directory -Name "src", "tests", "docs" creates those three folders in the current location. [1]

Before you run a command like this, check that the destination is the one you intend and that each folder name is spelled correctly. A quick review can prevent folders from being created in the wrong place or with an unwanted name. This guide shows the basic command and how to prepare its name list so you can create a group of folders directly in PowerShell. You may also find this useful: How to Create Folders From a Text List in Windows.

The example uses simple project folders: src for source files, tests for tests, and docs for documentation. Replace those names with the folders you need, and review the command before pressing Enter. Keep the names as separate entries in the list so PowerShell can handle them as individual folders.

Check the destination and folder names first

Relative paths in PowerShell are resolved from your current location, so check that location and review every folder name before running a creation command. This quick check helps prevent folders from landing in an unexpected place or being created with a typo.

Check the destination

At the PowerShell prompt, enter Get-Location to display the current location.

If you need a different parent folder, move there with Set-Location, followed by the full path in quotes. For example, use Set-Location "C:\Users\Sam\Documents\Project Files" to make that directory the current location. Check the prompt or run Get-Location again before proceeding.

Review the folder names

Read through the names you plan to use before running the command. Check spelling and capitalization, and look for repeated entries such as Invoices appearing twice. Remove accidental duplicates so the list reflects the folders you actually want.

A computer user reviews a destination path and a list of folder names in a PowerShell window.

Create multiple folders with New-Item

  1. Open PowerShell, then move to the parent folder where you want the new folders. For example, if you want them inside C:\Projects, change to that location before creating them. This command uses Set-Location:

    Set-Location "C:\Projects"
    
  2. Create the folders with New-Item, setting the item type to Directory and listing each folder name in quotes, separated by commas:

    New-Item -ItemType Directory -Name "src", "tests", "docs"
    

    In this example, PowerShell creates src, tests, and docs as directories inside the selected parent folder. [1] Use a separate quoted name for each folder you want; for example, you could replace these names with "Invoices", "Receipts", and "Tax Records".

  3. If you need to create folders in different locations, use -Path with multiple full paths instead of -Name:

    New-Item -ItemType Directory -Path "C:\Projects\src", "D:\Work\reports"
    

    The Path parameter accepts multiple strings, so you can use it to create items at separate paths. [2] Give each folder its own full path in the comma-separated list.

A PowerShell window shows a user creating several project folders on a desktop computer.

Verify the folders and fix common command mistakes

Check the destination and the names in the result after your PowerShell command runs. You can confirm the folders in File Explorer or list the destination’s contents in PowerShell; if anything is missing or misplaced, check the location and how the names were separated. Related reading: How to Create Multiple Folders in File Explorer.

Confirm the result

Open the destination folder in File Explorer and look for each expected folder. For example, if you created Finance, Public, and Archive, make sure all three appear in the intended parent folder. You can also run Get-ChildItem in PowerShell to display the items in the current location. If you’re checking a different destination, specify its path with Get-ChildItem -Path "C:\Work\Projects".

Correct misplaced or combined folders

If folders appear somewhere unexpected, check PowerShell’s current location with Get-Location. Compare it with the parent folder you intended to use, then run the creation command again with that parent’s path. For example, use C:\Work\Projects\Finance as the destination when the folders belong under C:\Work\Projects, rather than relying on an unintended current location.

If you see one folder whose name contains commas, the names may have been passed as one string instead of as separate values. Use a comma-separated list of individual names, such as "Finance", "Public", "Archive", not one quoted string like "Finance, Public, Archive". Check the displayed names before rerunning the command so you don’t create another set by mistake.

PowerShell folder creation options

The table shows how to choose a destination and create or verify multiple folders in PowerShell.

Task

Command or input

What it does

Check the current destination

Get-Location

Displays the current location.

Change the destination

Set-Location "C:\Projects"

Makes the specified directory the current location.

Create folders in one location

New-Item -ItemType Directory -Name "src", "tests", "docs"

Creates each listed folder in the current location.

Create folders at separate paths

New-Item -ItemType Directory -Path "C:\Projects\src", "D:\Work\reports"

Creates folders at the listed full paths.

Verify the result

Get-ChildItem

Displays items in the current location.

Frequently Asked Questions

How do I create multiple folders in PowerShell with one command?

Move to the parent folder where you want the new folders, then run New-Item -ItemType Directory -Name "src", "tests", "docs". PowerShell creates each listed name as a directory in the current location. Replace the example names with your own, keeping each folder name as a separate quoted entry.

How do I create folders in different locations with PowerShell?

Use New-Item with the -Path parameter and provide each folder’s full path as a separate quoted entry. For example, New-Item -ItemType Directory -Path "C:\Projects\src", "D:\Work\reports" creates folders at those listed paths.

How can I check where PowerShell will create the folders?

Run Get-Location to display PowerShell’s current location. Relative folder names are created from that location. If you want a different parent folder, use Set-Location with its full path in quotes, then check the location again before running the creation command.

Why did PowerShell create one folder with commas in its name?

The folder names may have been passed as one string instead of separate values. Use a comma-separated list of individual quoted names, such as "Finance", "Public", "Archive", rather than one quoted string like "Finance, Public, Archive". Check the displayed names before running the command again.

How do I verify that PowerShell created all the folders?

Open the destination in File Explorer and check for each expected folder, or run Get-ChildItem in PowerShell to list items in the current location. To check a different destination, provide its path with Get-ChildItem -Path, then compare the results with the folder names you intended to create.

Use the name list you checked

Your safest finish is simple: choose the destination, review the folder names, run the command, and verify that the folders appeared. For example, a direct command can create folders named src, tests, and docs in the selected location. [1]

Before you run it, make sure the destination is the parent folder you intended and the names match what you want to create. Then run the command and check the result in that location; seeing the three expected folder names confirms the basic task is done. [1]

Use this same short routine whenever you need a few folders for a project: decide where they belong, read the names once more, execute the folder-creation command, and confirm the result. Keep the example to direct folder creation, so each name becomes a folder rather than a file or a more complex path. [1]

Sources

  1. Create Directories in PowerShell: New-Item for Folders

  2. New-Item (Microsoft.PowerShell.Management)