PowerShell vs VBScript

Viewed 65

I have a ton of VB6 and VBScript for both work and personal usages. I am very familiar with both. Of course, the two main objects are FSO and WScript.Shell for VBScript.

Recently, I have been able to learn PowerShell and I absolutely love it. I have been a VB fan for the longest of time but I wished I would have learned PowerShell much earlier. Unfortunately, my focus has been in the BI world (SQL Server, Power BI, SSRS, Rest APIs, etc...)

Anyway, a few things so far that I really like PowerShell which separates from other windows scripting (VBScript, Batch, CMD, etc...)

  • Win32 API usages (no longer needs to build assemblies, com wrappers, etc... and call from VBScript)
  • Get-Child -Recursive one line literally replaced 20 VBScript lines
  • Output-File also one line literaly replaces 5 extra lines for FSO
  • Registry (Read, Write, Delete) very straight forward and no longer need WScript object
  • Get File Hash with one line of code rather than using .Net or third party.
  • Create custom forms and messagebox
  • VBScript clipboard (clip.exe) is very cheesy (appending extra characters to the beginning) and this was the reason for the discovery of PowerShell.

This is for my research and learning purposes. What else have you found that sets PowerShell apart from VBScript?

I have not tested PowerShell against database (SELECT, INSERT, UPDATE, DELETE) to MS SQL Server or MS Access. VBScript would use ADO. I have played a little bit with data tables and data views. Any thoughts?

1 Answers

The biggest, most important feature of Powershell is that it is still actively supported by Microsoft.

VBScript is not officially unsupported like VB6 (not supported since 2008). But it is supported only as legacy software. No new updates other than security patches or bugfixes. You will never get a faster engine, better development experience, new programming paradigms, or new features. Your development experience will be permanently trapped in 2002, developing in the same security-last, clunky, low performance programming patterns that dominated the 1990s.

VBScript, VB6, ASP Classic and Microsoft Access are dead tech walking, and have been for almost two decades now (a little less for Access which got the 'don't use this' flag in 2017).

There are a lot of things to love about Powershell, from Object-Oriented scripting, to effortless .NET compatibility to the easy relationship between script files and commands that makes anyone who's ever worked with Bash jealous. But all of these pale in comparison to the core feature of being supported.

Related