Skip to content

Instantly share code, notes, and snippets.

@NathanTheGr8
Last active September 17, 2018 18:21
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 NathanTheGr8/a2b4af71cb0c416420c768ae543b330d to your computer and use it in GitHub Desktop.
Save NathanTheGr8/a2b4af71cb0c416420c768ae543b330d to your computer and use it in GitHub Desktop.
# Configure Domain to scrape
$Domain = "https://notepad-plus-plus.org"
$AppendToDomain = "/download"
# build URL to scan
$SiteToScan = $Domain + $AppendToDomain
# Scan URL to download file
$url32 = ((Invoke-WebRequest -uri $SiteToScan).links | Where innerHTML -like “*Notepad++ Installer 32-bit*”).href
$url64 = ((Invoke-WebRequest -uri $SiteToScan).links | Where innerHTML -like “*Notepad++ Installer 64-bit*”).href
# Build URL to download file
$DownloadNotePad32 = $Domain + $url32
$DownloadNotePad64 = $Domain + $url64
Start-BitsTransfer -Source $DownloadNotePad32 -DisplayName Notepad -Destination "\temp\npp32.exe"
Start-BitsTransfer -Source $DownloadNotePad64 -DisplayName Notepad -Destination "\temp\npp64.exe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment