none
new-item -type undocumented parameter RRS feed

  • Question

  • new-item -ItemType "directory" D1

    seems to behave exactly like:

    new-item -type "directory" D2


    I couldn't find any document talking about the "type" parameter of new-item commandlet.

    What's going on here?

    thanks in advance




    • Edited by AgostinoX Sunday, September 16, 2018 9:47 AM
    Sunday, September 16, 2018 9:44 AM

Answers

  • Hi AgostinoX,

    The parameter -Type is just an alias for the parameter -ItemType.

    You can run the following command to check all the aliases.

    (Get-Command New-Item).parameters.values |
    select name, aliases

    After you execute the command you will be able to see that the alias for the parameter -ItemType is the parameter -Type.

    Please remember to mark this post as answer if I was able to help you resolve your problem.

    Sunday, September 16, 2018 9:54 AM

All replies

  • Hi AgostinoX,

    The parameter -Type is just an alias for the parameter -ItemType.

    You can run the following command to check all the aliases.

    (Get-Command New-Item).parameters.values |
    select name, aliases

    After you execute the command you will be able to see that the alias for the parameter -ItemType is the parameter -Type.

    Please remember to mark this post as answer if I was able to help you resolve your problem.

    Sunday, September 16, 2018 9:54 AM
  • "ItemType/Type" are listed under the provider.

    Help about_providers
    get-psprovider


    \_(ツ)_/

    Sunday, September 16, 2018 10:02 AM