[PS] Bug? New-Item's -ItemType parameter should have a -Type alias

Discussion in 'Scripting' started by Alex K. Angelopoulos [MVP], May 18, 2006.

  1. We can create a new file or directory with New-Item using the -ItemType
    parameter:
    PS> New-Item c:\temp\users -ItemType directory
    PS> New-Item c:\temp\users.txt -ItemType File

    Based on the standards for simpler parameter naming where a qualifier is
    obvious from the context, -ItemType _should_ have an alias to -Type.
     
    Alex K. Angelopoulos [MVP], May 18, 2006
    #1
    1. Advertisements

  2. -ItemType of New-Item does have -Type as an alias.
    PS C:\monad> (gcm new-item).parametersets[0].parameters[1] | select-object
    name,aliases

    Name
    Aliases
     
    Wei Wu [MSFT], May 18, 2006
    #2
    1. Advertisements

  3. Oops. My mistake. The problem is that it doesn't tab-complete, and I forgot
    to confirm that it really didn't exist after noticing that. :|

     
    Alex K. Angelopoulos [MVP], May 18, 2006
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.