Windows PowerShell 使用指南
1. PowerShell 命令概述
PowerShell 命令行界面会显示可用的 cmdlet 数量。若你安装了其他使用 PowerShell cmdlet 的产品(如 Exchange Server 2007),运行相关命令后显示的 cmdlet 数量可能会大幅增加。在撰写本文时,Exchange Server 2007 预计会提供约 350 个专门用于管理该服务器的 cmdlet。
2. 跨工具新方法
PowerShell 旨在通过 cmdlet 几乎完全覆盖 Windows 机器的管理任务,但 PowerShell 1.0 版本并未涵盖所有所需功能。为填补这些空白,可采用以下两种方法:
- 使用 .NET 类 :前文已提及。
- 使用 Windows Management Instrumentation(WMI) :PowerShell 提供了 get - wmiobject cmdlet 来检索机器状态信息。例如,要使用 WMI 检索当前日期和时间,可输入以下命令:
get - wmiobject –Namespace root\cimv2 –Class Win32_CurrentTime
该命令可缩写为:
get - wmiobject Win32_CurrentTime
超级会员免费看
订阅专栏 解锁全文
785

被折叠的 条评论
为什么被折叠?



