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

Create Files in PowerShell

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

Creating Files

Usage:New-Item -Path [filename] -ItemType File
-ItemType File
Create a file
-ItemType Directory
Create a directory

File Creation Examples

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

Knowledge Check

1 / 1

What flag creates a file?

References

These Microsoft Learn and Windows documentation links provide authoritative details for the commands used in this article.

Up Next

Create Directories in PowerShell

Build directory structures with New-Item.