PowerShell: create directory

By Xah Lee. Date: . Last updated: .

Create New Directory

Using mkdir

mkdir dirName

🟢 TIP: mkdir is a builtin function, not a Cmdlet , not alias.

Using New-Item

New-Item dirName -ItemType directory

Hide the Output

In a script, it is annoying that mkdir prints output. You can surrpress the output.

mkdir dirName | out-null

out-null suppress the useless info about the fact you created a directory.

More efficient way to hide output:

$null = mkdir dirName

PowerShell. Create New File or Dir

PowerShell. List Dirs and Files

List Dirs

List Files

Create, Copy, Delete, Dir

Path Tutorial