原始出處主要參考:
- 微軟官方(初階): http://technet.microsoft.com/zh-tw/library/bb978526.aspx
- alexc君之大作:http://ithelp.ithome.com.tw/event/ironmanarticle2/id/20005121/page/3
- Hyper-V的 Powershell http://technet.microsoft.com/en-us/library/hh848559.aspx
- 進階的玩意兒 http://code.tutsplus.com/tutorials/say-hello-to-powershell--net-32056
PowerShell的優點
1.物件導向,每個可執行的語法( Cmdlet )的命名都是動詞-名詞,如 Get-Acl,具結構性,好理解。
2.更容易探索Windows底層資訊(如WMI)
3.改善以往.VBS、bat檔編寫語法不一致的困擾。例如只要了解 Sort-Object 的用法,就能將大多數 Cmdlet 的輸出排序。
4.可呼叫.net、com,也保留對以往DOS指令的支援。
如何查詢語法與線上說明
Get-help 您要查的Cmdlet
例如 Get-help get-date
會出現
相關連結
Online version: http://go.microsoft.com/fwlink/?LinkID=113313
Set-Date
New-TimeSpan
註解
若要查看範例,請輸入: "get-help Get-Date -examples".
如需詳細資訊,請輸入: "get-help Get-Date -detailed".
如需技術資訊,請輸入: "get-help Get-Date -full".
變數宣告
以$字號表示,如 $ServiceName