Fetching OK and Failure Count from HTML Report using PowerShell

Welcome Forums General PowerShell Q&A Fetching OK and Failure Count from HTML Report using PowerShell

This topic contains 2 replies, has 3 voices, and was last updated by

Ron
 
Participant
2 years, 6 months ago.

  • Author
    Posts
  • #57182

    Participant
    Topics: 23
    Replies: 17
    Points: 1
    Rank: Member

    Hi All,

    I am having a HTML Report file. Raw file is here

    I need to extract the number(count) of OK and Failure . For example :

    Failure : 1
    OK : 43

    Kindly provide me with any solution or regex for this.

  • #57200

    Participant
    Topics: 2
    Replies: 376
    Points: 0
    Rank: Member
    $c = gc D:\Downloads\Test.html
    [regex]::matches($c,'ok').Count
    [regex]::matches($c,'Failure').Count
    
  • #57206
    Ron

    Participant
    Topics: 0
    Replies: 199
    Points: 2
    Rank: Member

    Load the web page text in a variable, $html.

    ([regex]::matches($html, ">okfailure<", "IgnoreCase")).count

The topic ‘Fetching OK and Failure Count from HTML Report using PowerShell’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort