Back to Blog
Arnošt Havelka

Create Files in PowerShell

Learn to create new files with New-Item.

Start Interactive Lesson
Create Files in PowerShell

The New-Item command creates new files and directories. Master this essential skill for file management.

Creating Files

Try the command

Create a new file!

Build the command
New-Item -Path [filename] -ItemType File
-ItemType FileCreate a file
-ItemType DirectoryCreate a directory
Terminal
C:\Users\User>New-Item -Path [filename] -ItemType File

File Creation Examples

Command Prompt
documents.txt
C:\Users\User>ls

Knowledge Check

1 / 1

What flag creates a file?

References

These documentation links provide authoritative details for the commands used in this article.

Up Next

Create Directories in PowerShell

Build directory structures with New-Item.