• get-childitem -Recurse -force -filter *.txt  <==>  dir /s *.txt 
    • -Recurse 遞迴
    • -force     列出隱藏檔
  • get-content a.txt  <==>  type a.txt
  • remove-item -Recurse *.txt  <==>  del /s *.txt
  • Write-Output "a is $a"  <==>  echo a is %a%

 

資料參考:Windows PowerShell In Action By Bruce Payette


ayowu 發表在 痞客邦 留言(0) 人氣()

資料夾有一堆檔案感覺很亂.....

若想要依據檔案的最後修改日期分類,例如依據年月
我們可使用以下的Script

ayowu 發表在 痞客邦 留言(0) 人氣()

http://soapbox.msn.com/video.aspx?vid=34791e54-ec34-4acb-818b-ff2b71d38115

 


ayowu 發表在 痞客邦 留言(0) 人氣()

一個人的行李
詞曲/ Penny

心情好or心情壞 有什麼好假裝
反正天若真的塌下來 我自己扛

ayowu 發表在 痞客邦 留言(0) 人氣()

  • DesktopEngineer.com提供三天的課程(1495美元)
    • Day 1 - Getting to Know PowerShell
      • What is PowerShell?
      • What are the Key New Items for Administrators?
      • Why You Should Care About the Key Differences
      • In what contexts can it run?
      • What new things are now in reach that may not have been before?
      • Smallest "Hello World" script in the world
      • Language Constructs and Symantecs (If, For)
      • What is pipelining, Object orientation, interactive environment
      • Text Editor comparison
      • Special Tools (psanalyzer)
      • Sample code, sample code, sample code
      • Input & Output
      • How to research building a script
    • Day 2 - Getting At The System
      • PowerShell Direct Access
      • Registry and Filesystem
      • WMI
      • ADSI
      • .NET (a little bit)
      • Interfacing with CMD.EXE and Other EXEs
      • PowerShell Shortcomings and Compensations
    • Day 3 - Porting Scripts And Best Practice
      • VBScript and NT Shell Scripts (.BAT/.CMD)
      • COM Object Access
      • Favoring Native PowerShell Functions
      • Porting String Functions
      • Replicating VBScript String Functions
      • Regular Expressions Primer
      • Simple Scripts versus Production Ready versus Scripting Framework
      • Framework Script (process arguments, tracing and logging, error processing)
  • 位於德國的AddOn提供三天的課程(1725歐元 )[以下內容是從德文翻譯成英文]
      • Power shell introduction
        • Term "Monad"
        • Characteristics of the power shell
        • Conditions
        • From HelloWorld to GUI
      • Power shell bases
        • Instruction types
        • Search sequence
        • CmdLets
        • Aliase
        • Classes and objects
        • Pipeline Processor
        • Important Cmdlets
    • Power shell LANGUAGE
      • Variable one
      • Operators
      • Array
      • Hash Tables
      • Inquiries
      • Loops
      • Functions
      • Filter
      • Error handling
      • Debugging
  • Scriptdateien
    • Files create
    • Comments
    • Call
    • Safety configuration
    • Profiles
  • System administration
    • Systems management with power shell
    • Use of .NET Classes
    • Windows management instrumentation (WMI)
    • Component Object Model (COM)
    • Selection assistance object model
    • Active directory service interface (ADSI)
    • Extensible Markup LANGUAGE (XML)
    • Exchange server 2007

  • ayowu 發表在 痞客邦 留言(0) 人氣()

    #使用get-content path顯示檔案內容
    PS C:\> get-content c:\a.txt

    #使用${path} 顯示檔案內容
    PS C:\> ${C:\a.txt}

    ayowu 發表在 痞客邦 留言(0) 人氣()


    #產生內容為PowerShell的char陣列
    PS C:\> [char[]]$Array = "P","o","w","e","r","S","h","e","l","l"

    #預設將陣列轉為字串時是以空白隔開

    ayowu 發表在 痞客邦 留言(0) 人氣()

    • 輸入:  "2+2 is (2+2)"
      結果:   2+2 is (2+2)
      • 一般字串
    • 輸入:  "2+2 is $(2+2)"
      結果:   2+2 is 4
      • 雙引號中會將$開頭的作解析,括號內解析為4
    • 輸入:  "2+2 is $2+2"
      結果:   2+2 is +2
      • 雙引號中會將$開頭的作解析,$2無此變數因此不顯示,+2視為一般字串;若是事先定義$2="a",則結果為2+2 is a+2
    • 輸入:  '2+2 is (2+2)'
      結果:   2+2 is (2+2)
      • 單引號所見及所得
    • 輸入:  '2+2 is $(2+2)'

    ayowu 發表在 痞客邦 留言(0) 人氣()

    在PowerShell中可以使用上下鍵瀏覽先前執行過的指令
    以利重複執行相同或類似的指令

    除此之外也可按下F7功能鍵瀏覽先前執行過的指令

    畫面跳出一小方塊

    ayowu 發表在 痞客邦 留言(0) 人氣()

    Technorati Profile


    ayowu 發表在 痞客邦 留言(0) 人氣()