Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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}
like image 812
Brock Steven Avatar asked Sep 06 '25 12:09

Brock Steven


1 Answers

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/
like image 112
Ansgar Wiechers Avatar answered Sep 09 '25 19:09

Ansgar Wiechers