Create a folder in PowerShell


Exchange 2013 Exchange 2016 Exchange 2019 Exchange Online Windows Server 2019
{“@context”:”https://schema.org”,”@type”:”HowTo”,”name”:”Create a folder with PowerShell”,”description”:”In this \”How To\” tutorial, I will show you how to create a folder in PowerShell.<br><br>To create a folder in PowerShell, use the <code>New-Item</code> cmdlet indicating the location and name of the folder and set the <code>itemType</code> parameter with the value Directory to indicate that you want to create a folder.<br><br>Example to create the SharedFolder folder at the root of drive C:”,”image”:{“@type”:”ImageObject”,”url”:””,”height”:”406″,”width”:”305″},”totalTime”:””,”estimatedCost”:[],”tool”:[],”supply”:[],”step”:[{“@type”:”HowToStep”,”url”:”#”,”name”:”Open a PowerShell window”,”text”:”On a server or a computer with a graphical interface, open a PowerShell prompt, preferably as an administrator to make sure you have the rights.”,”image”:””},{“@type”:”HowToStep”,”url”:”#”,”name”:”Use the New-Item Cmdlet to create the folder.”,”text”:”Enter the following command to create the SharedFolder folder at the root of the C drive:<br><br><code data-enlighter-language=\”generic\” class=\”EnlighterJSRAW\”>New-Item \”C:\\SharedFolder\” -itemType Directory</code>”,”image”:”https://rdr-it.com/wp-content/uploads/2020/02/ps-new-item-directory-1.png”},{“@type”:”HowToStep”,”url”:”#”,”name”:”The folder is created”,”text”:”On the screenshot above, you can see the return of the command, which indicates that the folder has been created.”,”image”:”https://rdr-it.com/wp-content/uploads/2020/02/ps-new-item-directory-result-1.png”}]}

Create a folder with PowerShell

In this “How To” tutorial, I will show you how to create a folder in PowerShell.

To create a folder in PowerShell, use the New-Item cmdlet indicating the location and name of the folder and set the itemType parameter with the value Directory to indicate that you want to create a folder.

Example to create the SharedFolder folder at the root of drive C:

Open a PowerShell window

On a server or a computer with a graphical interface, open a PowerShell prompt, preferably as an administrator to make sure you have the rights.

Use the New-Item Cmdlet to create the folder.

Enter the following command to create the SharedFolder folder at the root of the C drive:

New-Item "C:\SharedFolder" -itemType Directory

The folder is created

On the screenshot above, you can see the return of the command, which indicates that the folder has been created.

The New-Item cmdlet is used in PowerShell to create different types like folders, registry key, file …




Leave a Comment