3 ms·
> so why not use C# Because you need to compile your C# source first. With PowerShell you just write and run. Also in a PowerShell shell you can fart about an
by teh_klev 9y ago
> so why not use C#
Because you need to compile your C# source first. With PowerShell you just write and run. Also in a PowerShell shell you can fart about and test stuff without actually having to write a fully working script in a file, i.e. it's got its own REPL.
- maxxxxx 9y agoWith CSScript you don't have to compile first. It runs as a script.
- teh_klev 9y agoYes, I know, I was addressing your question and explaining why: > The main advantage of PowerShell is interop with .NET so why not use C#? Anyhow, I've written tens of thousands of lines of CScript and PowerShell over the past 15-20 years, give me PowerShell any day of the week for automation and admin tasks. Why anyone would persist with CScript/WSH for sysadmin tasks and automation (unless you're still managing an ancient fleet of Windows 2003/2000/NT) makes my mind boggle. Also you there's a reasonably useful IDE with ships with PowerShell so you can actually set breakpoints, step through your code and inspect variables (though I prefer to use PowerGUI). That alone is a massive productivity booster.