Help with Powershell New-Item Commandlet

Zachary Brass 1 Reputation point
2020-07-30T18:43:48.98+00:00

I am trying to create new items in Powershell, however, I get caught at the Item Type. This error message pops up and I do not know how to fix it: A parameter cannot be found that matches parameter name 'FileType'. What do I need to do? This is the line that I am inputting to get that output: PS C:\Users\zjunk> New-Item -Path E:\ -FileType Directory -Name "Personal Recipes". I love using powershell to do different tasks that might otherwise take a while to do manually

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Andy David - MVP 145.1K Reputation points MVP
    2020-07-30T19:40:12.713+00:00

    Its ItemType, not FileType

    https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-item?view=powershell-7

    ItemType
    Specifies the provider-specified type of the new item. The available values of this parameter depend on the current provider you are using.

    If your location is in a FileSystem drive, the following values are allowed:

    File
    Directory
    SymbolicLink
    Junction
    HardLink

    1 person found this answer helpful.

  2. 2020-08-05T01:55:44.627+00:00

    Hi,
    If you think the member’s answer is useful to you and solved your question, please don’t forget to mark it as an answer.That will encourage them very much.
    Or If you need further support please let us know. ;-)

    0 comments No comments