SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Pastimes : Computer Learning -- Ignore unavailable to you. Want to Upgrade?


To: FJB who wrote (97384)7/12/2017 11:46:46 PM
From: FJB  Respond to of 110581
 
There is a script at that link to download all the books. Replace "C:\Users\ENTER_YOUR_DOWNLOAD_DIRECTORY_HERE" with where you want to download them. Make sure the directory already exists.


NOTE: It will download the books in all available formats. So you will have up to four copies in some cases...

###############################################################
# Eric Ligmans Amazing Free Microsoft eBook Giveaway
# blogs.msdn.microsoft.com
# Link to download list of eBooks
# ligman.me
# Thanks David Crosby for the template (https://social.technet.microsoft.com/profile/david%20crosby/)
###############################################################

$dest = "C:\Users\ENTER_YOUR_DOWNLOAD_DIRECTORY_HERE"

# Download the source list of books
$downLoadList = "http://ligman.me/2sZVmcG"
$bookList = Invoke-WebRequest $downLoadList

# Convert the list to an array
[string[]]$books = ""
$books = $bookList.Content.Split("`n")
# Remove the first line - it's not a book
$books = $books[1..($books.Length -1)]
$books # Here's the list

# Download the books
foreach ($book in $books) {
$hdr = Invoke-WebRequest $book -Method Head
$title = $hdr.BaseResponse.ResponseUri.Segments[-1]
$title = [uri]::UnescapeDataString($title)
$saveTo = $dest + $title
Invoke-WebRequest $book -OutFile $saveTo
}