When I run my code :
$SearchClass = "allreportstd"
$URI = "https://MySite/Default.aspx"
$WebRequest = Invoke-Webrequest -URI $URI -UseDefaultCredentials
$WebRequest.ParsedHtml.getElementsByClassName($SearchClass) | % {Write-Host $_.innerText}
This produces the following output:
Workstations: Unsupported Win 10 editions (1803) (0)
Workstations: Unsupported Win 10 editions (1809 and earlier) (3)
Workstations: Unsupported Win 10 editions (1903) (7)
Workstations: Unsupported Win 2000 (0)
Workstations: Unsupported Win XP (1)
Workstations: Windows 10 editions (3775)
How to remove the last parentheses at the end of the line ?
- Workstations: Windows 10 editions (3775) becomes Workstations: Windows 10 editions
- Workstations: Unsupported Win 10 editions (1809 and earlier) (3) becomes Workstations: Unsupported Win 10 editions (1809 and earlier)
Thanks a lot for your help ..