diff --git a/Setup-Entity.ps1 b/Setup-Entity.ps1 index eb9988c..88bf9e9 100644 --- a/Setup-Entity.ps1 +++ b/Setup-Entity.ps1 @@ -211,7 +211,7 @@ function New-Entity { $pdfPath = $null Write-Host "Some entities get PT STMT files mixed into the same dated folder," -ForegroundColor DarkGray Write-Host "and those go to a different folder on the server." -ForegroundColor DarkGray - if (Read-YesNo "Do PT STMT files show up in the dated folders for $entityName?" "n") { + if (Read-YesNo "Do PT STMT files show up in the dated folders for ${entityName}?" "n") { $pdfPath = Read-RemotePath "the PT STMT files" $null } @@ -415,18 +415,16 @@ function Set-Field($object, $name, $value) { } function Show-Settings($config) { - $proto = if ($config.ftps.protocol) { $config.ftps.protocol.ToUpper() } else { "(not set)" } Write-Host "" Write-Host " Daily upload" -ForegroundColor White - Write-Host " Server : $(Show-Value $config.ftps.host) over $proto" + Write-Host " Server : $(Show-Value $config.ftps.host) over $(Show-Protocol $config.ftps 'ftp')" Write-Host " Login : $(Show-Value $config.ftps.username) / $(Show-Password $config.ftps.password)" Write-Host " Images to : $(Show-Value $config.ftps.tiff_path)" Write-Host " PT STMT to: $(Show-Value $config.ftps.pdf_path)" Write-Host "" Write-Host " Patient files" -ForegroundColor White if ($config.workflow -eq "insurance+patient") { - $pproto = if ($config.sftp.protocol) { $config.sftp.protocol.ToUpper() } else { "(not set)" } - Write-Host " Server : $(Show-Value $config.sftp.host) over $pproto" + Write-Host " Server : $(Show-Value $config.sftp.host) over $(Show-Protocol $config.sftp 'sftp')" Write-Host " Login : $(Show-Value $config.sftp.username) / $(Show-Password $config.sftp.password)" Write-Host " Files to : $(Show-Value $config.sftp.patient_path)" } else { @@ -434,6 +432,15 @@ function Show-Settings($config) { } } +# Reports the protocol the upload will actually use, so a legacy config that +# only carries an "ftps://" prefix on the host doesn't read as unset. +function Show-Protocol($conn, $fallback) { + if ([string]::IsNullOrWhiteSpace([string]$conn.host)) { return "(not set)" } + $protocol = (Get-ConnProtocol $conn $fallback).ToUpper() + if ($conn.protocol) { return $protocol } + return "$protocol (assumed)" +} + function Show-Value($value) { if ([string]::IsNullOrWhiteSpace([string]$value)) { return "(not set)" } return [string]$value