[p] Bug? New-Item should support more generic -ItemType values

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

  1. In using New-Item with the filesystem provider, I've noticed that it's
    pretty picking about the -ItemType being explicitly either file or
    directory.This obviously needs to be a named value, but I think it should
    probably support the following as well, some of them VERY generic:

    + the word "folder" should be supported for the filesystem provider.
    + the word "container" should be supported generically for all providers
    where a container of some kind (a key, filesystem directory, or other
    nesting completely generic container) can be created. This might not work
    for all providers, but for ones where containers are primarily namespace
    organizers it would be highly reusable.
    Alex K. Angelopoulos [MVP], May 18, 2006
    1. Advertisements

  2. Alex K. Angelopoulos [MVP]

    Marty List Guest

    I agree with Alex, especially on "folder". This is easier to type and seems to
    be the preferred MS terminology in the shell, help files, KB articles, etc.
    Although "directory" is still relevant, use of this term is moving more towards
    actual directories like LDAP/AD.
    Marty List, May 18, 2006
    1. Advertisements

  3. Alex K. Angelopoulos [MVP]

    dreeschkind Guest

    I agree.
    The NoteProperty that Get-ChildItem adds to it's results is called
    "PSIsContainer" and I think "container" sounds more general for providers
    than "directory".
    dreeschkind, May 18, 2006
  4. Thanks for the feedback -- please file this on MS Connect.

    Lee Holmes [MSFT]
    Windows PowerShell Development
    Microsoft Corporation
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Lee Holmes [MSFT], May 19, 2006
  5. Alex K. Angelopoulos [MVP], May 19, 2006
    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.