PowerTip: Use PowerShell to Create New File

Doctor Scripto

Summary: Create a new file with Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to create a new text file that will be empty until I add content?

Hey, Scripting Guy! Answer Use the New-Item cmdlet and specify a path, name, and type, for example:

New-Item c:\fso\AnEmptyFile.txt -ItemType file


Discussion is closed.

Feedback usabilla icon