tags:

views:

70

answers:

1

What is Get-Command -CommandType Script? What kind of commands does it cover? Help about Script tells “-- Script: Script blocks in the current session.” but I am not sure what kind of script blocks it means. Are there cases when Get-Command -CommandType Script actually returns anything?

+2  A: 

The get-command commandtype parameter reuses an enum that is used elsewhere in powershell. In other places where it's used (for example, in the parser), it will make sense to be of type Script. But in this case, for get-command, Script is not a value that is actually relevant for command types.

-Oisin

x0n
Oisin, thank you. Hmm, apparently better names could be `Script` instead of `ExternalScript` and `InternalScript` (for example) instead of not designed for public use `Script`. It’s too late, indeed. This is not the end of the world but that’s still noticeable: `Get-Command` is the primary command for newcomers and due to this design they may have funny user experience right from the start.
Roman Kuzmin