Created
November 3, 2023 20:38
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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