PowerShell – Will It Be The End of VBScript?

PowerShellWith the growing popularity of Microsoft PowerShell – the new batch scripting language from Microsoft, it seems that VBScript was dealt yet another blow in one of it’s last vanguards, the server admin scripting space.

For years, VBScript was the de-facto language for quick scripts to manage operations across Windows Servers. With its integration to COM APIs, VBScript made it easy to manage DNS, Active Directory, Exchange, or other Windows Server components that were challenging to manage through batch files.

The advent of PowerShell, however, makes it even easier to perform advanced operations. With a Python-like language, .Net integration, and enhanced command-line capabilities, PowerShell provides sys admins an easy way to manage multiple servers and code scripts in a fraction of the time it previously took with VBScript.

Even more exciting is the capability to combine the best of both Linux and Windows through Cygwin. With a stronger focus on the command line than VBScript, PowerShell can easily run Linux Cygwin programs. For instance, where the Windows FTP client lacks synchronization, Linux’s lftp can be used to mirror directory structures and easily push out updates to a network of websites.

When getting started with PowerShell – there are two important hacks to make the scripting language truly powerful. First, the signed scripting requirement needs to be disabled in order to easily prototype and build test scripts. Second, the registry needs to be updated in order to assign the ps1 extension to PowerShell scripts, so that the scripts run automatically on double-click or through command-line calls.

On a final note, be sure to add a clause below at the beginning on any script to verify whether the user truly wants to run the program. There is nothing worse than accidentally clicking on a program and having it delete half your hard drive. The lines of code below will save you many heart-aches, be sure to include them at the top of any PowerShell script:

$confirm = Read-Host "This script will [Enter Purpose Here].
Type 'y' to continue"

If ($confirm -eq ‘y’) {}
else { exit }

With its extensibility and ease of coding, PowerShell is slowly ringing the death knell for VBScript. Once Office Apps finally convert to a JavaScript-based language, we will finally be able to retire the VBScript language to the annals of software development history.

Written by Andrew Palczewski

About the Author
Andrew Palczewski is CEO of apHarmony, a Chicago software development company. He holds a Master's degree in Computer Engineering from the University of Illinois at Urbana-Champaign and has over ten years' experience in managing development of software projects.
Google+

RSS Twitter LinkedIn Facebook Email

One thought on “PowerShell – Will It Be The End of VBScript?”

  1. Actually, in very critical situations we (apHarmony – Custom Software Development Chicago) recommend asking the question twice in different format and in such a way that would avoid mechanical clicking two times on “Yes” answer.

Leave a Reply

Your email address will not be published. Required fields are marked *