Poll: Interactive versus Script

Tagged: 

This topic contains 7 replies, has 7 voices, and was last updated by Profile photo of Peter Kriegel Peter Kriegel 3 years, 10 months ago.

  • Author
    Posts
  • #9444
    Profile photo of Hal Rottenberg
    Hal Rottenberg
    Participant

    I'm just curious: how do you use PowerShell most often?

    A) I sit in the shell and execute cmdlets and tasks interactively

    or

    B) I have an editor open all the time and write scripts

    Of course, we all do both things, but I'm asking for a relative comparison. I personally am in the shell 90%+ of the time. I had a conversation with some PowerShell MVPs recently, and I get the distinct impression that most of them are writing scripts most of the time. I'm curious to hear what everyone else says.

  • #9448
    Profile photo of Poshoholic
    Poshoholic
    Member

    50/50 for me. In the shell to work out logic ad hoc, then in scripts to build commands, then back in the shell to test and work out more ad hoc work, rinse, repeat.

  • #9449
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    Mostly scripting, I'd say, but that's to be expected at my job. We have around 5000 servers (and a bazillion POS devices) in the retail space, and most of the work gets done by pushing out scripts rather than interactively connecting to them, except when troubleshooting.

  • #9450
    Profile photo of Richard Siddaway
    Richard Siddaway
    Moderator

    At the moment probably 80:20 scripting to shell. More shell when I'm testing.

    I don't view PowerShell as an either/or activity and in my opinion it is a huge mistake to do so. PowerShell gives us the opportunity and capability to work almost seamlessly from ad hoc interactive work to modules of advanced functions or CDXML that require a moer developer orientated approach. Because we can work where we need to on that spectrum wee get the power to solve our automation problems.

    Pigeon holing PowerShell and your activities is a sure way to stunt the growth of capability

  • #9463
    Profile photo of Hal Rottenberg
    Hal Rottenberg
    Participant

    Richard, you crack me up. You are either doing what the psychologists call projecting, or...I don't know. Anyway, I'm certainly not pigeon-holeing PowerShell to be one or the other. It is and shall always be, a platform with the flexibility inherent in that term. The irony is that when I make a suggestion about the language, and I get sort of befuddled responses of "why the heck would anyone ever want to do that?" (made even more ironic by the fact that my suggestion described behavior that was changed), it makes me wonder what am I doing differently that my INCREDIBLY OBVIOUS suggestion isn't seen instantly as such by my peers. I thought about it for a minute, and the premise of this poll is what I decided might be the cause.

    I personally am very heavy on the shell side in how I ordinarily use PowerShell, I've always known this. That makes me value certain shell-oriented features more highly than others. (Duh.) That's all. I'm just curious as to the distribution. Would love to get more responses.

  • #9471
    Profile photo of Art Beane
    Art Beane
    Member

    How about C) Use the ISE with Script Pane Maximized and switch back and forth between the script and console panes frequently?

    In fact, I usually have several concurrent open instances of the ISE in this mode, often with several scripts open in each.

  • #9546
    Profile photo of Boe Prox
    Boe Prox
    Participant

    I'd say about 70:30 script to shell in my environment. Usually I am supporting other projects or putting together scripts that will be used in scheduled jobs for reporting and other things or being provided to others to use. For some things like querying Active Directory or pulling information from WMI, I usually just stick with the shell. I also use the shell for testing out the scripts that I write.

  • #9548
    Profile photo of Peter Kriegel
    Peter Kriegel
    Participant

    90:10 script to shell in my environment. My collegs fear the console and scripting so I have to build tools for the colored pixel clickers 😉

You must be logged in to reply to this topic.