Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell vs C# [closed]

Tags:

c#

powershell

So before I invoke the ire of SO purists, I am aware of When to develop using Powershell vs C#?. However I believe that the state of the art has changed since then.

So firstly the big take away from the last Powershell vs C# question was that inheriently Powershell is an interpreted language vs C# being a compiled language.

However I feel that as Roslyn matures this argument will hold no water.

So why do I want to learn Powershell. Given that:

  • C# can (in theory) be run in an interpreted environment.
  • C# has better tooling support (e.g. Resharper) and documentation
  • C# has great error checking (the compiler)
  • I already know C#
like image 448
Aron Avatar asked Aug 19 '13 04:08

Aron


People also ask

Is PowerShell faster than C?

C is by far the fastest of them all.

Is PowerShell similar to C?

PowerShell has syntax that is related to 'C' languages. It is not a C language and does not work like any C language. PowerShell can create as many array dimensions as you want very easily.

Is C# better than PowerShell?

I might hear someone say (or write) that PowerShell is not as performant than C#, so C# is better. This is… irrelevant, If we are scripting a task to be automated and repeated than performance is likely secondary and writing a nice easy to read and maintain script is what matters.

Is C# in PowerShell?

The C# program will be executed in a real . NET thread that is created in the Windows PowerShell script by using a helper class that is compiled in memory at runtime too. This helper class provides some synchronous . NET events that can be subscribed in Windows PowerShell to handle the console output.


1 Answers

To be precised PowerShell is much more for admins. It is because it gives similar tool (cmdlets) to manage different systems

But PowerShell is also very useful for developers when they are working on for example filesystem. Last week I had to find same string in many .NET solutions. Using 3 cmdlets I found what I needed in a second. Developing same in C# will take much time

like image 189
Piotr Stapp Avatar answered Oct 04 '22 11:10

Piotr Stapp