powershell how to create a file code example
Example 1: powershell new folder
New-Item -ItemType directory -Path C:\Scripts\newDir
Example 2: powershell new file
New-Item -Path . -Name "testfile1.txt" -ItemType "file" -Value "This is a text string."
Example 3: powershell create file content
Set-Content D:\temp\test\test.txt 'Welcome to TutorialsPoint'
Example 4: powershell new item
New-Item "C:\file.txt" -ItemType File -Force