Search code examples
c#powershelladministrationsystem-administration

When to develop using Powershell vs C#?


I'm just getting started in PowerShell and one of my sysadmins told me that Powershell can do as much as C# can for systems management, if not more.

Please forgive the ignorance of this question, but when would I use Powershell over C#?


Solution

  • When I worked in the Windows build lab a LONG time ago (1997) the rule I was taught that if the code satisfies either of these two conditions write it in interpreted script, otherwise write it in compiled code:

    1. there's more overhead than code (using/include lines, function declaration, etc)
    2. there's a better than 10% chance that the code will change before it gets run again