What is the definition of "External Commands" ?

This topic contains 3 replies, has 3 voices, and was last updated by  Lockdown 2 months, 3 weeks ago.

  • Author
    Posts
  • #95118

    Lockdown
    Participant

    What is the definition of "External Commands" ?

    Is it everything other than cmdlets ? Or everything other than cmdlets, functions, worrkflows, etc = everything other than what is native to PowerShell itself – the list provided by the "Get-Command" cmdlet ?

  • #95121

    postanote
    Participant

    Simply put.
    Any executable / console applications / command line interactive stuff – .exe, .com, etc...

    For example you can get the banned list of external commands directly form PoSH itself. Just by looking at the list provided by the variable below, but this really and PowerSHell_ISE thing. The console window below the ISE script pane is not the true PoSH console host. It is not designed for external interactive command line stuff. You can do it, but you have to know absolutely every parameter needed and you must type in inline, in the script pane or the ISE console.

    $psUnsupportedConsoleApplications
    
    wmic
    wmic.exe
    cmd
    cmd.exe
    diskpart
    diskpart.exe
    edit.com
    netsh
    netsh.exe
    nslookup
    nslookup.exe
    powershell
    powershell.exe
    
    These are the defaults. You can add more.
    As a rule, if you really need to use these types of things. Stick with the true PoSH console host (powershell.exe). 
    
  • #95130

    Richard Siddaway
    Moderator

    Simpler to think of it as "if its not powershell its an external command"

    The online help at https://docs.microsoft.com/en-gb/powershell/module/Microsoft.PowerShell.Core/Get-Command?view=powershell-5.1
    gives a list of PowerShell command types

    • #95139

      Lockdown
      Participant

      So the answer to my original question:

      Or everything other than cmdlets, functions, worrkflows, etc = everything other than what is native to PowerShell itself – the list provided by the "Get-Command" cmdlet ?

      =

      "YES"

You must be logged in to reply to this topic.