[PS] Difference between "get-command" and "get-command *"

Discussion in 'Scripting' started by Andrew Watt [MVP], May 15, 2006.

  1. If I use the command

    get-command

    only cmdlets are returned.

    If I use the command

    get-command *

    I get commands of several command types.

    Why?

    Thanks

    Andrew Watt MVP
     
    Andrew Watt [MVP], May 15, 2006
    #1
    1. Advertisements

  2. Andrew Watt [MVP]

    forestial Guest

    It looks like "get-command *" is trying to list every file that is anywhere
    on the path. It's difficult to see the utility of this. Perhaps it is
    intended to list only "executable" files - that would seem to make sense with
    the name "get-command" but it is not what actually happens.

    Also, the output from "get-command *" produces some strange looking results.
    Many files are listed with CommandType "Application", including such
    unlikely names as: (these are just a few examples of files of various
    extensions on my system)

    #GetRandom.cs#
    0702.reg
    040917.EVT
    _DataPerfCounters.h
    about_Alias.help_txt
    CONTROL.INI
    Cpp.CodeProvider.xml
    aspnet_state_perf.ini
    asycfilt.dll

    ..... none of which matches what I think of as an Application.
     
    forestial, May 15, 2006
    #2
    1. Advertisements

  3. The current behavior of "get-command -type application" gets all files in
    $env:path with a file association. I concur this is ugly.
    Please open a bug.

    --
    Wei Wu [MSFT]
    Windows PowerShell Team
    Microsoft Corporation
    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Wei Wu [MSFT], May 15, 2006
    #3
  4. 75829 on Connect.

    Andrew Watt MVP
     
    Andrew Watt [MVP], May 16, 2006
    #4
    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.