從CMD到PowerShell

cmd bat 批次檔 PowerShell ps1

2021-01-25

Select-String

來源內容
    TXT檔案
        -Path 檔名
        -Path FileInfo物件
        -Encoding 參數
        用 gc 讀取TXT,尋找比較慢
    變數
        字串陣列
        物件屬性
        使用管線 (字串 vs FileInfo)
        之前找到的結果(MatchInfo物件)

關鍵字
    -Pattern 參數
    -SimpleMatch 參數
    -CaseSensitive 參數

命令的結果
    傳回MatchInfo物件
    -NotMatch 參數
    -List 參數
    -Quiet 參數
    -Context 參數
    -AllMatches 參數

MatchInfo物件
    Path屬性、Filename屬性、LineNumber屬性
    Pattern屬性
    IgnoreCase屬性
    Line屬性、Matches屬性
    Match物件 - Groups屬性
    Match物件 - Captures屬性
於 1月 25, 2021
以電子郵件傳送這篇文章BlogThis!分享至 X分享至 Facebook分享到 Pinterest
標籤: PowerShell

沒有留言:

張貼留言

較新的文章 較舊的文章 首頁
訂閱: 張貼留言 (Atom)
圖片視窗主題. 技術提供:Blogger.