什么是 Windows PowerShell? [英] What is Windows PowerShell?

查看:42
本文介绍了什么是 Windows PowerShell?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是 PowerShell?

What is PowerShell?

我安装了 Windows 7,我注意到它有 PowerShell.我记得在注册 Windows Azure 时安装了它,但只是因为它是必需的.

I have Windows 7 installed, and I noticed that it has PowerShell. I remember installing this a while back when signing up for Windows Azure, but only because it was required.

用超级外行的术语解释是什么?:)

What would the explanation be in uber-layman's terms? :)

推荐答案

PowerShell 是一种新的 Windows 命令外壳和脚本语言.它很酷的原因有很多:

PowerShell is a new command shell and scripting language for Windows. It is cool for a lot of reasons:

语言是理智的,尤其是与 CMD 相比时.

The language is sane, especially when compared to CMD.

脚本和命令行共享一种语言.CMD 有许多微小但重要的差异.不解释 CScript 和 Windows Scripting Host.

Scripts and command line share a language. CMD had many small but important differences. CScript and Windows Scripting Host are not interpreted.

命令行使用速度很快,而脚本可读,这要归功于别名和智能命令参数处理的组合.例如,dir -r .Get-ChildItem -Recurse -Path "."

Command line usage can be quick while scripts can be readable, thanks to the combination of aliases and smart command argument processing. For example, dir -r . is the same as Get-ChildItem -Recurse -Path "."

一致的命令参数语法,跨所有 cmdlet 和自定义脚本(在 V2.0 中).

Consistent command argument syntax, across all cmdlets and custom scripts (in V2.0).

与其他技术的强大交互,尤其是 .NET.此外,WMI 突然变得方便且易于访问.COM也在那里.V2 也让 Win32 互操作变得简单.

Powerful interaction with other technologies, most notably .NET. Also, WMI is suddenly convenient and accessible. COM is there, too. V2 makes Win32 interop easy, too.

V2 中非常酷的集成脚本编辑器/交互式 shell.

命令管道适用于对象,而不是字符串,这意味着您不需要解析,并且您可以为人类设置文本格式,而不是下一个命令.在 bash 中,我做了很多 cut,但在 PowerShell 中我不必这样做.对象是真正的.NET 对象,非常强大.

Command pipelines work on objects, not strings, which means you don't need to parse, and you can format text for humans not the next command. In bash I did a lot of cut, but in PowerShell I don't have to. The objects are real .NET objects, which is very powerful.

在使用 PowerShell 之前,我设法成为 CMD 脚本编写方面的专家,但现在我可以开始抹掉我大脑的那部分.谢天谢地.

Before PowerShell I managed to become an expert in CMD script writing, but now I can start erasing that part of my brain. Thank goodness.

值得一提的是,许多 Microsoft 产品都添加了 PowerShell 支持,尤其是服务器产品.例如,Exchange 附带 PowerShell cmdlet,因此您可以通过 PowerShell 管理您的 Exchange 服务器.

It's worth mentioning that lots of Microsoft products are adding PowerShell support, especially for server products. For example, Exchange ships with PowerShell cmdlets, so you can administer your Exchange server via PowerShell.

这篇关于什么是 Windows PowerShell?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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