VBS vs PowerShell: Which is lighter?

前端 未结 2 917
一向
一向 2021-02-15 16:59

If I need a script that executes with minimum effort from the system, which would I choose?

By looking at processes at Task Manager:

Memory (Private Working Set)

2条回答
  •  不思量自难忘°
    2021-02-15 17:09

    This clearly depends on what you need the script to do. There are vast differences in the capabilities between PowerShell and vbscript. PowerShell can leverage most capabilities of the .NET framework where vbs cannot. So there are some many things that you simply won't even be able to do with VBS.

    If the script needs to do something that both can accomplish, typically you can accomplish the same thing in PowerShell in far fewer lines of code which makes the script easier to maintain and distribute. Sometimes what takes 10-50 lines of VBS can be accomplished by typing in a single PowerShell line at the shell.

    So why do you need lightweight? Does the fact VBS may take slightly relatively less memory out weigh the benefits of PowerShell I talked about above? PowerShell will make you more productive and allow you to accomplish more due to it's powerful capabilities and will take less of your time and effort to do it.

提交回复
热议问题