From 1b2f292850326d3175952dc57a9296d6662fd382 Mon Sep 17 00:00:00 2001 From: jpenner-gbs <38986389+jpenner-gbs@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:05:26 -0700 Subject: [PATCH] Enable Tls1.2 and json conversion should use AsHashtable --- doc-downloader.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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