diff --git a/doc-downloader.ps1 b/doc-downloader.ps1 index d3a73ad..f321749 100644 --- a/doc-downloader.ps1 +++ b/doc-downloader.ps1 @@ -1,5 +1,6 @@ $Config = Get-Content "configurations.json" | ConvertFrom-Json +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ### Configuration variables found in configurations.json $API_KEY = $Config.api_key @@ -72,7 +73,7 @@ do{ $redirect = $BASE_URL + $response.Headers["Location"] WriteToLog ("Redirecting to URL " + $redirect) $log_file $queuedDoc = GetDocFromQueue $redirect $HEADERS $log_file - $queuedDoc = $queuedDoc | ConvertFrom-Json + $queuedDoc = $queuedDoc | ConvertFrom-Json -AsHashtable $downloadURI = $queuedDoc.download_url WriteToLog ("Downloading Document from " + $downloadURI) $log_file $file_count++ @@ -111,4 +112,4 @@ while($response.StatusCode -eq 302) $Timer.Stop() WriteToLog("------------------------") $log_file WriteToLog ("Script total run time: " + $Timer.Elapsed.ToString()) $log_file -WriteToLog ($file_count.ToString() + " documents downloaded." + "`r`n") $log_file \ No newline at end of file +WriteToLog ($file_count.ToString() + " documents downloaded." + "`r`n") $log_file