From eb99637c0effef6de4966c7356fccd568e3c7363 Mon Sep 17 00:00:00 2001 From: eeckert Date: Thu, 10 Aug 2023 13:57:50 -0600 Subject: [PATCH] fixing output name --- Download-SnapperReports.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Download-SnapperReports.ps1 b/Download-SnapperReports.ps1 index 01cf2dd..7c0c0a5 100644 --- a/Download-SnapperReports.ps1 +++ b/Download-SnapperReports.ps1 @@ -7,7 +7,7 @@ $header = @{ auth_token = $APIToken } | ConvertTo-Json -$OutputPathBase = "M:\N-Data\FieldReports\TestPath" +$OutputPathBase = "C:\Users\eeckert\Downloads\ArchiSnapper" # get list of projects # https://docs.archisnapper.com/reference/retrieving-your-projects @@ -34,7 +34,7 @@ do { if ($_) { Write-Debug -Message ("Checking " + $_.unique_id) -Debug $testURI = $_.pdf_link + '&auth_token=' + $USING:APIToken - $Outfile = $USING:OutputPathBase_Project + '\' + $_.unique_id + '_' + $_.Date.Substring(0,10) + ".pdf" + $Outfile = $USING:OutputPathBase_Project + '\' + $_.Date.ToString().Substring(0,10) + '_' + $_.unique_id + ".pdf" if (!(Test-Path $Outfile)) { Write-Debug ("Saving file: " + $Outfile) -Debug Invoke-WebRequest -Uri $testURI -OutFile $Outfile