VBS vs PowerShell: Which is lighter?

前端 未结 2 926
一向
一向 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:28

    There is a conservation of work principal going on here. If the machine does less work, then you have to do more work. If the machine does more work, you have to do less work.

    Our philosophy with PowerShell was that the most important resource was the Admin's time and attention so we spend machine resources to deliver the best possible experience. So if you are looking for the lightest possible footprint on the machine, you should code it in 'C'. C++ is heavier than that and VBS is even heavier, and C# is even heavier, and they are lighter than PowerShell. Of course each one also requires more effort to produce a solution than PowerShell.

    So the end of the day, what you end up with is a continuum of choices and what you need to do is decide what is the right tool for the problem at hand. We understood that from the beginning so we designed PowerShell to provide a smooth glide path to C# => C++ => C. This allows you to start with PowerShell and if it is too heavy, you can transition to another language without having to start over from scratch like you do with PERL => C.

提交回复
热议问题