A new Powershell command structure is necessary

Powershell has a big problem. A very big problem.

Problem is the structure of the commands.

Commands (cmdlets) start with a verb, like New, Get, Remove,etc.

And this structure makes Powershell chatty: There are too many commands.

For almost every object, Powershell defines at least four commands: get, set, new,remove

For example, for Active Directory users the following commands are available:

Get-ADUser

New-ADUser

Remove-ADUser

Set-ADUser

For IIS sites, there are more than four commands:

Get-IISSite

New-IISSite

Remove-IISSite

Start-IISSite

Stop-IISSite

There are thousands of objects in Windows and Powershell, in current structure, will create thousands and thousands new commands.

With so many commands there comes so many problems:

You must learn the syntax of each command.

Powershell team must write quality help information about every command.

Everyone who has worked with Powershell knows that sometimes help info is insufficient.

So, I propose a new command structure:

Commands must start with object names, instead of verbs!

After the objects there can be commands.

For example, instead of the above four commands related to AD users, the new commands could be:

Aduser Get

Aduser New

Aduser Set

Aduser Remove

For the above IIS site commands, the new commands could be:

IISsite get

IISsite new

IISsite set

IISsite remove

IISsite stop

IISsite start

This new structure would reduce the number of the commands significantly.

The help information about the commands could be written more efficiently.

Murat Yildirimoglu

My e-book on classic command prompt:
https://books.google.co.uk/books/about/Windows_Command_Prompt.html?id=VpiSDQAAQBAJ&redir_esc=y

Reklamlar

3 Yanıt to “A new Powershell command structure is necessary”

  1. David Jones Says:

    I think you missed the whole point to how it works.
    Aduser -get |aduser -set would be more difficult for people with no prior admin skills to learn. The current format is not new, it was based on other more mature and just as easy to read languages.
    More commands may march the Swiss army knife approach of old unix utils, but reading an single man page then size of an encyclopedia is on small task

  2. jaykul Says:

    There is no such problem.

    But even if there were, your solution would not solve anything. You haven’t REDUCED the number of commands, you’ve simply HIDDEN EVERY COMMAND behind a root command, like the `net` or `diskpart` commands — your top level “noun” command doesn’t do anything except list all the verbs inside it.

    WORSE YET, we’ve tried that system in shells for decades — with this mechanism is it not possible for THIRD PARTIES to extend the noun, because the verbs are embedded in it. So you would not only double the difficulty of discovering things, you’d break the ability to add to them.

    • muratyildirimoglu Says:

      Jaykul 1) There is a problem. There are people who are not so vocal like you but see a problem here. 2) Number of the commands would be really reduced. The commands are what is displayed when you fire get-command. This number will be less than one fourth of the current one. The options-switches do not make them seperate, independent commands. If so, currently Powershell has much more commands:)

Bir Cevap Yazın

Aşağıya bilgilerinizi girin veya oturum açmak için bir simgeye tıklayın:

WordPress.com Logosu

WordPress.com hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap /  Değiştir )

Google+ fotoğrafı

Google+ hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap /  Değiştir )

Twitter resmi

Twitter hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap /  Değiştir )

Facebook fotoğrafı

Facebook hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap /  Değiştir )

Connecting to %s


%d blogcu bunu beğendi: