Last active
September 17, 2018 18:21
-
-
Save NathanTheGr8/a2b4af71cb0c416420c768ae543b330d to your computer and use it in GitHub Desktop.
Taken and modified from https://www.reddit.com/r/PowerShell/comments/3o0o8z/script_to_download_notepad/
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
# 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