locked
Why powershell? RRS feed

  • General discussion

  • I might be totally wrong but I am not able to answer few questions, why powershell and why not use Vbscripts?

    I might be upsetting few Powershell gurus and fanatics by stating that I did not find any **WOW!!** factor in powershell.

    I am totally new to powershell and I was kind of forced to learn this language as a media hype and job requirements. After on a month of reading the manuals and writing few scripts ( still Struggling ) I really did not find powershell as extremly easy compared to VBScripts, as many have mentioned "very easy compared to vb". From my exprience VBScripts does pretty much every thing powershell can do. please correct me if ia m wrong.

    When few of my colleague asked me why powershell?, only thing i can think of was it can use .net features apart from that i dont find powershell as more powerful or any different to VBscript. I wish microsft had considered enhance vbscript rather than developing a new language.

    Any suggestiions from gurus ? 

    • Changed type Vincent Hu Monday, July 19, 2010 3:18 AM
    • Changed type Vincent Hu Monday, July 19, 2010 3:19 AM
    Monday, July 19, 2010 12:45 AM

All replies

  • PowerShell remoting was a big one for me. I've written VBScripts in the past that went out and connected to thousands of computers, one-by-one, to perform some minor configuration change. With fan-out remoting, it's very easy to perform actions on dozens of computers in parallel.

    I also find it much easier to share a complicated script with a less-knowledgeable administrator. In VBScript, it took a lot of effort to build-in documentation and make it behave more like a command-line exe. Advanced functions in PowerShell make it trivial to document a custom cmdlet. Then I just need to teach someone how to use Get-Help once, instead of writing a how-to for every script. Modules are a very easy way to pass around code, and building a windows forms GUI in PowerShell is much more flexible than coding an HTA.

    The consistency and discoverability of PowerShell makes it easier for someone to learn compared to VBScript. It's hard for someone fluent in another scripting language to recognize it, but looking back at my early VBScripting days...it was a long time before I moved beyond cutting and pasting. Get-Member has saved me massive amounts of time I would have spent reading MSDN documentation to figure out what methods and properties were available for me to use in a VBScript.

    The "entry fee" for using PowerShell is much lower than VBScript. Someone with zero programming knowledge can very easily get started running some cmdlets, start piping cmdlets together, then start saving those commands to ps1 files. It's a much more gradual learning process than VBScript, and someone just starting can perform many useful tasks right from the beginning.

    PowerShell allows Microsoft to build a consistent platform for managing their products from the command line. Automating Microsoft products has always been a hodge-podge of WMI, COM and EXEs. Now that PowerShell is part of the Common Engineering Criteria, more and more Microsoft products will be completely accessible through a consistent command line interface.

    PowerShell certainly isn't a silver bullet, but the more I use it the more I see the improvements.

     

    Monday, July 19, 2010 1:41 AM
  • Hey JHofferle,

    Thanks for the reply. Very intersteing thing was remoting!.. though I really dont understand the full functionality of it does it deiffer a lot in connecting to the remote computer using WMI?

    Monday, July 19, 2010 2:11 AM
  • Hey JHofferle,

    Thanks for the reply. Very intersteing thing was remoting!.. though I really dont understand the full functionality of it does it deiffer a lot in connecting to the remote computer using WMI?


    Remoting was introduced in PowerShell v2, and there are several different ways it can be used. One way is through the Enter-PSSession cmdlet, where you are interacting with a remote computer as if you were sitting at it. Another common method is through Invoke-Command where one script or command can be executed against an entire list of computers very efficiently.

    I suggest watching Don Jones' Presentation on PowerShell Remoting for a very good introduction:

    Manage Your Enterprise from a Single Seat: Windows PowerShell Remoting

    Monday, July 19, 2010 2:29 AM
  • great videos .. especially from Don Jones...

    Strange that even though I get some code in Powershell the syntax and the layout still resembles Vbscripts. I find really very hard to understand and read  anything  "|" that is piped and are one line scripts.

     

    Monday, July 19, 2010 5:28 AM
  • "|" concept is not revolutionary or new. It's been used in *nix world for many years now.
    Monday, July 19, 2010 8:57 AM
  • PowerShell as a language is a very well-done mash-up of many proven
    programming language ideas. To understand PowerShell from a language
    point of view I recommend Bruce Payette's book "PowerShell in Action".
    The next version of that book will be out soon.
     
     

    Monday, July 19, 2010 11:35 AM
  • One point that Don Jones pointed out while I was taking his class, Microsoft is creating a two-tier structure within administration on many of it's products. Tier 1 will be the average admin, who has access to a GUI. Tier 2 will be the advanced administrator who knows how to use PowerShell. Apparently there are already some functionality within AD that is available in PowerShell only, not through the GUI. I wouldn't be at all surprised to see more of that in other products like SharePoint in the future.

    It's not a WOW moment, but it is does give you a pretty powerful reason to learn PowerShell. After all, which set of admins is likely to get paid more, Tier 1 or Tier 2?

    Monday, July 19, 2010 1:38 PM
  • one other big difference is, its a shell...

    i can just basically run code on the fly, rather than write a vb script. i can just write command after command and watch the results as each is executed. i've found it to be much faster to write scripts that way, i can just copy/paste code segmets in a console and get results. with a vb script if im writing a longer more complex script it become hard to test segments of it. I mostly write scripts but im starting to do a lot of admin work with it now too (thanks to that remoting) and im loving it.

    also i find things like regex to be way easier to do in powershell, and on that note you've got access to most of .net with little effort. to me its kind of like saying, why C# over vbs?

    PS. Im using the bridge, and this thread didnt show up correctly, i only got Chanakya's responses, anyone else see that? im using the community bridge, not the MS one.

    Justin

    Monday, July 19, 2010 2:25 PM
  • I might be totally wrong but I am not able to answer few questions, why powershell and why not use Vbscripts?

    I might be upsetting few Powershell gurus and fanatics by stating that I did not find any **WOW!!** factor in powershell.

    I am totally new to powershell and I was kind of forced to learn this language as a media hype and job requirements. After on a month of reading the manuals and writing few scripts ( still Struggling ) I really did not find powershell as extremly easy compared to VBScripts, as many have mentioned "very easy compared to vb". From my exprience VBScripts does pretty much every thing powershell can do. please correct me if ia m wrong.

    When few of my colleague asked me why powershell?, only thing i can think of was it can use .net features apart from that i dont find powershell as more powerful or any different to VBscript. I wish microsft had considered enhance vbscript rather than developing a new language.

    Any suggestiions from gurus ? 

    The "WOW" factors for me are as follows:

    1. Having access to the .NET framework.
    2. Conciseness.  I took great pleasure in porting Vbscripts of 100+ lines to 10-20 line powershell scripts.
    3. Being a shell as well as a scripting language.
    After using Powershell for a few years now, I refuse to code anything new in Vbscript -- the language just feels completely antiquated.

    Monday, July 19, 2010 2:52 PM
  • "|" concept is not revolutionary or new. It's been used in *nix world for many years now.


    PowerShell piping is revolutonary because it sends objects down the pipeline. *nix sends text.

     

    Monday, July 19, 2010 4:51 PM
  • I might be totally wrong but I am not able to answer few questions, why powershell and why not use Vbscripts?

    I might be upsetting few Powershell gurus and fanatics by stating that I did not find any **WOW!!** factor in powershell.


     

    There were many **WOW!!**s for me:

    - Wow! Microsoft finally came up with a standard, extensable command line environment!

    - Wow! PowerShell sends objects down the pipeline!

    - Wow! Anything can be exposed as if it they were directories and files on a disk!

    - Wow! It's all backed by a standard help system!

    - Wow! It's really east to create my own cmdlet!

    - Wow! It's really easy to host a PowerShell environment!

    - Wow! I just have to write objects to the pipeline and leave the formatting up to someone else!

    - Wow! If I don't like the formatted output, it is really easy to change!

    I could go on...

     

    Monday, July 19, 2010 5:01 PM
  • I got the Powershell WOW factor, and John in his post above pretty much summed them up, but if you still want to use VBScript then use it.  With all the custom VBScript scripts that are out there I doubt it's going anywhere.

    I'm just glad that Microsoft have finally given us all a proper shell. The biggest WOW factor for me was it took them so long. It's been really well designed as well  Bruce Payette and the Powershell team have done an excellent job with it's internals. That's a little wow as well because sometimes Microsoft can get that wrong, sometimes something is over engineered... too many things to too many people.

    Monday, July 19, 2010 5:18 PM
  • And, you can easily capture a transcript of your PowerShell sessions
    into a text file from which you can go back and glean all sorts of
    working patterns from your explorations at the command prompt.
     
    Here are the two lines I added to my profile.ps1 profile to always
    capture a daily transcript:
     
       $global:TRANSCRIPT = "$env:UserProfile\My
    Documents\WindowsPowerShell\Transcripts\PSLOG_{0:dd-MM-yyyy}.txt" -f
    (Get-Date)
       Start-Transcript -Append
     
     
    On 7/19/2010 9:25 AM, jrich wrote:
    > one other big difference is, its a shell...
    > i can just basically run code on the fly, rather than write a vb script.
    > i can just write command after command and watch the results as each is
    > executed. i've found it to be much faster to write scripts that way, i
    > can just copy/paste code segmets in a console and get results...
    >
     
    Monday, July 19, 2010 6:54 PM
  • I use the Community Bridge also, but never use a threaded view, so I may
    have not seen that.
     
    One thing that does happen that is not right is that my posts via the
    Community Bridge have beginning whitespace trimmed from their lines. I
    have to go into the web page to edit them to add code indentation back in.
     
    I'll check to see if I'm getting all the posts here that show up in the
    webpage...and yes, they all show up here in the NNTP newsgroup on this
    side of the bridge.
     
     
     
    On 7/19/2010 9:25 AM, jrich wrote:
    > PS. Im using the bridge, and this thread didnt show up correctly, i only
    > got Chanakya's responses, anyone else see that? im using the community
    > bridge, not the MS one.
    > Justin
    >
     
     
    Monday, July 19, 2010 7:22 PM
  • Thanks Larry,
    I was also seeing that some were not posting due to formatting issues. closing and opening live mail worked. maybe I just need a different news reader..
     
    Justin
    Monday, July 19, 2010 7:46 PM
  • I use Thunderbird.
     
    On 7/19/2010 2:46 PM, jrich wrote:
    > ... maybe I just need a different news reader..
    > Justin
     
     
    Monday, July 19, 2010 8:03 PM
  • And, you can easily capture a transcript of your PowerShell sessions
    into a text file from which you can go back and glean all sorts of
    working patterns from your explorations at the command prompt.
     
    Here are the two lines I added to my profile.ps1 profile to always
    capture a daily transcript:
     
       $global:TRANSCRIPT = "$env:UserProfile\My
    Documents\WindowsPowerShell\Transcripts\PSLOG_{0:dd-MM-yyyy}.txt" -f
    (Get-Date)
       Start-Transcript -Append
     
     
    On 7/19/2010 9:25 AM, jrich wrote:
    > one other big difference is, its a shell...
    > i can just basically run code on the fly, rather than write a vb script.
    > i can just write command after command and watch the results as each is
    > executed. i've found it to be much faster to write scripts that way, i
    > can just copy/paste code segmets in a console and get results...
    >
     

    I started using something like that a few months ago at work.  Saved me a few times...
    Monday, July 19, 2010 8:18 PM