PowerShell Script

DownLoad Windows PowerShell from: http://www.microsoft.com/technet/scriptcenter/topics/msh/download.mspx

Blog : http://pshscripts.blogspot.com/

PowerShell 相關資源:

1.下載PowerShell 1.0 (PowerShell 2.0 CTP也出來了,只可惜不支援Windows 2003)
http://www.microsoft.com/downloads/details.aspx?FamilyId=10EE29AF-7C3A-4057-8367-C9C1DAB6E2BF&displaylang=en

2.PowerShell CheatSheet,撰寫PowerShell時用的小抄,不過內容略嫌簡單、涵蓋範圍不大,有點不夠用的感覺。
http://www.microsoft.com/downloads/details.aspx?FamilyId=DF8ED469-9007-401C-85E7-46649A32D0E0&displaylang=en

3.PowerShell HelpFile。CHM格式的說明文件,寫得很詳細也很淺顯易讀,是佛心級的好文件,其中VBScript與PowerScript的指令對照表更是功德無量!!!
http://www.microsoft.com/downloads/details.aspx?FamilyId=3B3F7CE4-43EA-4A21-90CC-966A7FC6C6E8&displaylang=en

For more information on Windows PowerShell visit:
http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

Microsoft TechNet Script Center
http://www.microsoft.com/technet/scriptcenter/default.mspx

跑ps1 Script檔時,會先遇到此錯誤:
File C:\Program Files\Console2\check-file.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.
At line:1 char:15
+ ./check-file.ps1 <<<<

基於安全的理由,ps1 Script預設是不給跑的,記得用以下的指令調整安全設定:
Set-ExecutionPolicy RemoteSigned

資料引述:http://blog.darkthread.net/blogs/darkthreadtw/archive/2007/11/23/my-first-powershell-script.aspx

針對目錄中特定檔案的解壓指令_7z

 

    平常,對於檔案或是目錄的壓縮、解壓,都習慣在 Windows GUI 介面操作,一點也不覺得困擾。

    有次,因為工作關係要連續性的處理很多相同步驟的解壓工作,加上每次解壓時間長短不一,有些需要解上 30 ~ 40分鐘;心想,總不能這樣等.....,才能繼續下一個解壓工作。這時候,就想到 DOS 的批次作業用法。

    經過多次測試,發現要解壓一個完整的目錄:容易。但是要從一個被壓縮目錄中,解出特定的檔案來,就要有點”技巧”。

    下列用法,是以產生 .7z 解縮格式的 7z 程式為範例:

  1. 解壓一個完整的目錄,到指定的目錄位置下
    "C:\Program Files\7-Zip\7z"  x  Z:\DB01_20091218.7z  -oD:\A-Zip
  2. 從一個被壓縮目錄中,解出特定的檔案,到指定的目錄位置下
    "C:\Program Files\7-Zip\7z"  x  Z:\DB01_20091218.7z  -oD:\A-Zip  DB01-2009-12-18.bak  -r