何时使用Powershell和C#进行开发? [英] When to develop using Powershell vs C#?

查看:64
本文介绍了何时使用Powershell和C#进行开发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用PowerShell,我的一名系统管理员告诉我,Powershell可以完成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.

请原谅这个问题的无知,但是我什么时候可以在C#上使用Powershell?

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

推荐答案

我很久以前(1997年)在Windows构建实验室中工作时,根据该规则,我被教导说,如果代码满足这两个条件中的任何一个,则将其写入解释的脚本,否则将其编写为已编译的代码:

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. 比代码(使用/包含行,函数声明等)要多得多的开销
  2. 在重新运行代码之前,对代码进行更改的机率要好于10%

这篇关于何时使用Powershell和C#进行开发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆