PowerShell
外观
Windows PowerShell是Windows最新一代的命令列介面。
範例
- 停止所有目前執行中的以"p"字元開頭命名的程式:
PS> get-process p* | stop-process
- 停止所有目前執行中的所有使用大於1000MB記憶體的程式:
PS> get-process | where { $_.WS -gt 1000MB } | stop-process
- Calculate the number of bytes in the files in a directory:
PS> get-childitem | measure-object -property length -sum
- 等待一個叫做"notepad"的程式執行結束:
PS> $processToWatch = get-process notepad PS> $processToWatch.WaitForExit()
- 將"hello, world!"字串轉為英文大寫字元,成為"HELLO, WORLD!":
PS> "hello, world!".ToUpper()
- 在字串"string"的第1個字元後插入字串"ABC",成為"sABCtring":
PS> "string".Insert(1, "ABC")
- Download a specific RSS feed and show the titles of the 8 most recent entries:
PS> $rssUrl = "http://blogs.msdn.com/powershell/rss.aspx" PS> $blog = [xml](new-object System.Net.WebClient).DownloadString($rssUrl) PS> $blog.rss.channel.item | select title -first 8
- Sets $UserProfile to the value of the UserProfile environment variable
PS> $UserProfile = $env:UserProfile
支援應用程式
Application | Version | Cmdlets | Provider | Management GUI |
---|---|---|---|---|
Exchange Server | 2007 | 402 | 是 | 是 |
Windows Server | 2008 | 是 | 是 | 否 |
Microsoft SQL Server | 2008 | 是 | 是 | 否 |
System Center Operations Manager | 2007 | 74 | 是 | 否 |
System Center Virtual Machine Manager | 2007 | 是 | 是 | 是 |
System Center Data Protection Manager | 2007 | 是 | 否 | 否 |
Windows Compute Cluster Server | 2007 | 是 | 是 | 否 |
Microsoft Transporter Suite for Lotus Domino[1] | 08.02.0012 | 47 | 否 | 否 |
IBM WebSphere MQ[2] | 6.0.2.2 | 44 | 否 | 否 |
Quest Management Shell for Active Directory[3] | 1.0.5 | 29 | 否 | 否 |
Special Operations Software Specops Command[4] | 1.0 | 是 | 否 | 是 |
VMware Infrastructure Toolkit[5] | 1.0 Beta | 102 | 否 | 否 |
Internet Information Services[6] | 7.0 | CTP | 是 | 否 |
Ensim Unify Enterprise Edition[7] | 1.6 | 是 | 否 | 是 |
![]() | 这是一篇與计算机相關的小作品。您可以通过编辑或修订扩充其内容。 |
外部連結
- ^ Microsoft Transporter Suite for Lotus Domino. [2008-03-07].
- ^ MO74: WebSphere MQ - Windows Powershell Library. [2007-12-05].
- ^ PowerShell Commands for Active Directory Quest Software. [2007-12-05].
- ^ PowerShell Remoting through Group Policy. [2007-12-07].
- ^ VMware Infrastructure Toolkit for Windows Beta. [2008-03-29].
- ^ IIS 7.0 PowerShell Provider Tech Preview 1. [2008-04-15].
- ^ Exchange Manager for 2003 and 2007. [2008-04-23].