June 7th, 2015

PowerTip: Use PowerShell to Create New File

Doctor Scripto
Scripter

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

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.