I have googled for the below question, but could not find any answer. Can someone help me on this; What is the command to create a new file through Windows Powershell?
Use the echo Command to Create a New Text File Through Windows PowerShell. The echo command is a built-in alias for PowerShell's Write-Output cmdlet. It is similar to other shells that use echo . Both commands write the output to the pipeline and redirect the output to a new file.
Ensure you open PowerShell as an administrator to install it. After the chocolatey package is installed, you can run this command to install the nano editor. You can use the nano editor on the PowerShell console to edit a text file. It will open the GNU nano editor to make changes to any text file.
To create a folder in PowerShell, use the New-Item cmdlet indicating the location and name of the folder and set the itemType parameter with the value Directory to indicate that you want to create a folder.
I'm guessing you're trying to create a text file?
New-Item c:\scripts\new_file.txt -type file
Where "C:\scripts\new_file.txt" is the fully qualified path including the file name and extension.
Taken from TechNet article
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With