Powershell’s social responsibility

The world is not as polite anymore as it was years ago. People are forgetting what was called “good behavior / manner”. And Powershell is entering the world and starting to monopolize in the world of scripting languages.

I think Powershell should show some level of social responsibility. And today, I’m taking action to change it:

I, Ulf B. Simon-Weidner, propose hereby that Powershell should be forced to show more social responsibility. Therefore I propose two actions:

  1. Any command executed should, by default, set the –whatif parameter
    (This would prevent the commands from executing, it’ll only tell us what it would do)
  2. To really execute a command, the –please Parameter must be used, which will revoke the –whatif parameter.

Wouldn’t this be nice?



12 Responses to “Powershell’s social responsibility”

  1.   BPuhl Says:

    I imagine this as the same world, where when you try to do something, the UI experience is like this:

    “Are you sure?” [yes]
    “Are you really sure?” [yes]
    “Are you really, really sure?” [yes]

    Having personally been responsible for multiple domain-wide issues, there is no amount of “social responsibility” that will prevent a determined administrator from doing something dumb.

    Though I will admit, I’m a big fan of the -whatIf concept… :)

    Reply

  2.   joe Says:

    Because the commands just aren’t long enough already…

    Reply

  3.   James Pogran Says:

    No, not at all. The default function of an executable is to execute, not to ask permission. Cmdlets, functions, scripts, are all there to perform work. If you want to use whatif, use it. Don’t force contrary behavior on the rest of the world.

    Reply

  4.   June Blender Says:

    3. All shared PowerShell tools (scripts, functions, cmdlets, modules, and snap-ins should have help (with examples).

    Reply

  5.   Rob Says:

    -OrElse in place of -Force?

    Reply

  6.   UlfBSimon-Weidner Says:

    James – this is not serious – I just didn’t think that a smiley is necessary ;)

    Reply

  7.   BSonPosh Says:

    Have you tried setting $whatifpreference?

    $WhatIfPreference = $true

    Reply

  8.   Rick Sheikh Says:

    @June – PowerShell has great help built-in with examples.

    Reply

  9.   Dmitry Sotnikov Says:

    Ulf,

    The mode you describe is actually already supported by PowerShell: http://dmitrysotnikov.wordpress.com/2009/09/17/set-whatif-on-by-default/

    Dmitry

    Reply

  10.   Rick Sheikh Says:

    Dmitry is pointing out that setting the -whatif parameter as default is already doable. http://dmitrysotnikov.wordpress.com/2009/09/17/set-whatif-on-by-default/

    Reply

  11.   Sean Says:

    Don’t forget Thank You upon a successful completion.

    Expicitly adding a “:)”

    Reply

  12.   Florian Says:

    I suggest instead of -force, one could use a
    -isaidPLEASE parameter.

    Reply

Leave a Reply

*