MichaelJLittle / PowerShell

Powershell
0 stars 0 forks source link

Create New file #1

Open MichaelJLittle opened 1 month ago

MichaelJLittle commented 1 month ago

New-Item -Path . -Name "testfile1.txt" -ItemType "file" -Value "This is a text string."

MichaelJLittle commented 1 month ago

can avoid listing -path if you are already in the directory you need to be in

MichaelJLittle commented 4 weeks ago

(1..10) | ForEach-Object {New-item “MyNewFile$_.txt”}

for mutiple files. will post in current directory, each number goes up by one.