顯示具有 PowerShell 標籤的文章。 顯示所有文章
顯示具有 PowerShell 標籤的文章。 顯示所有文章

2008年12月30日 星期二

PowerGUI Script Editor

要寫 PowerShell 的 script 是一件痛苦的事,因為不像 c# 有 Visual Studio 的 IDE 開發環境支援。
因此, PowerGUI 誕生了。請參考這裡

2008年9月19日 星期五

PowerShell 學習(2)

Get-PSDrive 的結果,可以看到 PowerShell 的 drives。好玩的是它將 registry 也當成 drive 了
image

輸入 cd hklm: 後,再 dir,就真的將 hklm 當成 drive 了
image

而且,還可以建目錄 (md),刪除目錄 (rd)。使用 regedit32 來看結果時,還真的有出現值呢。

PowerShell 學習(1)

get-command 取得所有的 command 說明
get-help get-service 取得 get-service 這個 cmdlet 的說明
get-help get-service -detailed 取得 get-service 這個 cmdlet 的詳細說明
get-service | where-object {$.Status -eq "Running"} 取得狀態等於Running的服務
get-service | where-object {$_.Name -eq "dns"} | stop-service 1 取得所有的服務
2 其中名稱為 dns
3 停止符合條件的服務
get-process | get-member 取得 get-process 回傳物件的member
get-PSDrive 取得 PS的 drives

Share with Facebook