.net - What is powershell good for? -


i'm competent c# programmer, , newbie powershell. wonder, it's for? more of programmer's tool or admin's?

please share experience. when easier write script using .net assemblies c# tool? real, production tasks use for?

upd: maybe question should "what it's compared c# not batch".

writing c# tool typically need set visual studio project (or project in ide, or if doing "manually", need @ least build script call c# compiler). if specific task seems overhead, , need simple one-file-source-and-program-is-all-in-one solution, powershell script may better alternative.

edit: making answer cw, can add here reasons why may prefer powershell script agains c# solution:

  • you don't have visual studio (or other c# ide) installed on machine, or not used @ (like lot of sysadmins)
  • the program small don't need debugger, simple console outputs it
  • you not want maintain more 1 file
  • you don't want separate configuration parameters tool separate config file
  • when can define individual tasks, can't determine exact workflow, mixture of script , c# ideal. creating cmdlets or providers in c# gives scripts access in general way, , powershell becomes glue, making workflow flexible new situations.
  • you have several competing overarching design ideas , want rapidly test possibilities feasibility. powershell's soft typing , pipeline architecture makes easy ignore lot of vagaries of control structure , type details , heart of algorithm.
  • (...) add more reasons here

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -