Posted on by Jooho L
Unix/Linux
$ touch directory/filename.[extension]
Windows PowerShell
$ new-item -type file directory/filename.[extension]
Usage:
- Create a file or multiple files
- Create a directory
- Create a profile
$ New-Item -Path . -Name “testfile.txt” -ItemType “file” -Value “This is an example string.”
$ New-Item -Path “c:\” -Name “testdir” -ItemType “directory”
Learning resources:
Windows PowerShell Documentation; Learning PowerShell @ Microsoft