Brock Steven
Brock Steven

Reputation: 53

Powershell download entire directory contents

http://gisdata.nd.gov/NAIP/2012/zGeoTiffs/

I would like to download the entire directory, each link contains another series of links.

This is what I have so far and it works sort of (brings back a 200 status), but it doesn't download

import-module bitstransfer
invoke-webrequest “http://gisdata.nd.gov/NAIP/2012/zGeoTiffs/”
select -exp links|where{$_.href -like "*.tif"}
select -exp href|foreach{start-bitstransfer $_ F:\GIS\2012GeoTiff}

Upvotes: 4

Views: 18605

Answers (1)

Ansgar Wiechers
Ansgar Wiechers

Reputation: 200273

Unless PowerShell is a requirement, using wget would be an easier way to mirror something like that:

wget --mirror --no-parent --accept=tif http://gisdata.nd.gov/NAIP/2012/zGeoTiffs/

Upvotes: 5

Related Questions