Friday, March 12, 2021

Use Powershell to Create A File

Sometimes you need to create a file in a directory for testing.  Here is a simple way to create an empty file in the current directory using powerhell.

New-Item newfile.txt -ItemType file

If you want to create the file in a different directory you can specify the path.

New-Item c:\directory\newfile.txt -ItemType file

No comments: