Skip to content

Instantly share code, notes, and snippets.

@sunnyc7
Created November 3, 2023 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunnyc7/b7c71ca44f61869bdfd100d51420b7bc to your computer and use it in GitHub Desktop.
Save sunnyc7/b7c71ca44f61869bdfd100d51420b7bc to your computer and use it in GitHub Desktop.
If you like NTInsider from OSR Systems, but don't like clicking things
# If you like reading NT Insider but don't like clicking.
$savePDFTo = "$env:TEMP\NTInsider"
$uri = "https://www.google.com/search?q=site:insider.osr.com+filetype:pdf+inurl:pdf&sca_esv=579237292&rlz=1C1CHBF_enUS1055US1055&sxsrf=AM9HkKlzAaBYLDpNc_IsOEqzno14_5ICyw:1699043261820&filter=0&biw=2327&bih=1210&dpr=1.1"
$res = Invoke-WebRequest -UseBasicParsing -Uri $uri
$pdf = $res.Links | where {$_ -match "PDF" -and $_ -match "insider.osr.com"}
foreach ($f in $pdf) {
$filtered = $f.href | where {$_ -match 'http://insider.osr.com/'}
$pdfURL = (($filtered -split '&')[0] -split '=')[1]
$pdfURL
$outFileName = $savePDFTo + ($pdfURL -split '/')[-1]
Invoke-WebRequest -UseBasicParsing -Uri $pdfURL -OutFile $outFileName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment