fixing output name

This commit is contained in:
Erik Eckert 2023-08-10 13:57:50 -06:00
parent 6c430f8c24
commit eb99637c0e

View File

@ -7,7 +7,7 @@ $header = @{
auth_token = $APIToken auth_token = $APIToken
} | ConvertTo-Json } | ConvertTo-Json
$OutputPathBase = "M:\N-Data\FieldReports\TestPath" $OutputPathBase = "C:\Users\eeckert\Downloads\ArchiSnapper"
# get list of projects # get list of projects
# https://docs.archisnapper.com/reference/retrieving-your-projects # https://docs.archisnapper.com/reference/retrieving-your-projects
@ -34,7 +34,7 @@ do {
if ($_) { if ($_) {
Write-Debug -Message ("Checking " + $_.unique_id) -Debug Write-Debug -Message ("Checking " + $_.unique_id) -Debug
$testURI = $_.pdf_link + '&auth_token=' + $USING:APIToken $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)) { if (!(Test-Path $Outfile)) {
Write-Debug ("Saving file: " + $Outfile) -Debug Write-Debug ("Saving file: " + $Outfile) -Debug
Invoke-WebRequest -Uri $testURI -OutFile $Outfile Invoke-WebRequest -Uri $testURI -OutFile $Outfile