the_votekick

PS Query Website Content

Oct 13th, 2021 (edited)
442
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $uri = "https://covidlive.com.au/vic"
  2. $data = Invoke-WebRequest $uri
  3. $table = $data.ParsedHtml.getElementsByTagName("table") | Select -first 2 | Select-Object -Skip 1
  4. clear
  5. $Vic = ($table | select -ExpandProperty innertext)
  6. Write-Host $Vic -ForegroundColor red ## Table Contents
  7.  
  8. $Vic = $Vic.Trim("CATEGORYTOTALVARNET")
  9. $Vic = $Vic.Substring(0, $Vic.IndexOf('Overseas'))
  10. Write-Host $Vic -ForegroundColor yellow ## Single row with desired content
  11. #clear
  12. $Vic = ($Vic).Replace(' ',"`nNew Cases: ")
  13. $Vic = ($Vic).Replace('Cases',"Cases: ")
  14.  
  15.  
  16. Write-Host $Vic -ForegroundColor Green
RAW Paste Data