What does the PowerShell cmdlet <code>New-Item</code> do?New-Item creates a new item like a file or folder at a specified location.
Reports in PowerShell using New-Item?Use New-Item -Path . -Name Reports -ItemType Directory to create a folder named Reports in the current directory.
New-Item?The -ItemType parameter tells New-Item what kind of item to create, like File or Directory.
notes.txt using New-Item?Run New-Item -Path . -Name notes.txt -ItemType File to create an empty text file in the current folder.
New-Item that already exists?By default, New-Item will give an error if the item exists.
New-Item to create a folder?The correct parameter is -ItemType Directory to create a folder.
New-Item -Path . -Name file.txt -ItemType File do?This command creates a new empty file named file.txt in the current directory.
New-Item -ItemType Directory?The -Force parameter allows New-Item to create parent directories automatically when using -ItemType Directory.
-ItemType value for New-Item?Folder is not a valid -ItemType value; use Directory instead.
log.txt in a specific folder C:\Logs?Use -Path for the folder and -Name for the file name.
New-Item in PowerShell.