Compare commits

..
2 Commits
Author SHA1 Message Date
blanceandClaude Fable 5 585befe922 Stamp VERSION.txt with 0747612
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FNu4zbdNqYpX5jAVcU31GA
2026-08-30 20:33:03 -05:00
blance 0747612810 Make the login test work next to any uploader, not just this one
Melissa is going with the script she built with ChatGPT, so the
diagnostic has to stand on its own. It now finds WinSCPnet.dll wherever
it is - a WinSCP folder beside the script, one folder up, a normal
WinSCP install under Program Files, or anywhere below the script - and
asks for the path only if all of that misses.

Unblock-File is registered but throws on Linux, so Get-Command was not a
usable guard for it; wrapped instead.
2026-08-30 20:33:03 -05:00
2 changed files with 46 additions and 9 deletions
+44 -7
View File
@@ -3,7 +3,6 @@
# with it. Called by test-login.bat. # with it. Called by test-login.bat.
$scriptRoot = Split-Path -Parent $PSCommandPath $scriptRoot = Split-Path -Parent $PSCommandPath
$winscpDll = Join-Path $scriptRoot "WinSCP\WinSCPnet.dll"
function Read-Answer($question, $default) { function Read-Answer($question, $default) {
while ($true) { while ($true) {
@@ -31,18 +30,56 @@ Write-Host ("=" * 64) -ForegroundColor Cyan
Write-Host "" Write-Host ""
Write-Host "Type the details exactly as they work in WinSCP or FileZilla." -ForegroundColor Gray Write-Host "Type the details exactly as they work in WinSCP or FileZilla." -ForegroundColor Gray
if (-not (Test-Path $winscpDll)) { # Find WinSCPnet.dll wherever it happens to live - this script is meant to be
Write-Host "" # dropped next to whatever uploader is in use, not just this one.
Write-Host "WinSCPnet.dll not found at $winscpDll" -ForegroundColor Red function Find-WinSCPDll {
Write-Host "Run setup.bat first, or copy this script next to the WinSCP folder." -ForegroundColor Yellow $parent = Split-Path -Parent $scriptRoot
exit 1 $candidates = @(
(Join-Path $scriptRoot "WinSCP\WinSCPnet.dll"),
(Join-Path $scriptRoot "WinSCPnet.dll"),
(Join-Path $parent "WinSCP\WinSCPnet.dll"),
(Join-Path $parent "WinSCPnet.dll"),
"C:\Program Files (x86)\WinSCP\WinSCPnet.dll",
"C:\Program Files\WinSCP\WinSCPnet.dll"
)
foreach ($c in $candidates) {
if (Test-Path $c) { return $c }
}
# Anywhere under the folder this script sits in.
$found = Get-ChildItem -Path $scriptRoot -Filter "WinSCPnet.dll" -Recurse -File -ErrorAction SilentlyContinue |
Select-Object -First 1
if ($found) { return $found.FullName }
return $null
} }
Get-ChildItem -Path (Join-Path $scriptRoot "WinSCP") -Recurse -File |
$winscpDll = Find-WinSCPDll
if (-not $winscpDll) {
Write-Host ""
Write-Host "Could not find WinSCPnet.dll automatically." -ForegroundColor Yellow
Write-Host "It sits either in a WinSCP folder next to your upload script, or" -ForegroundColor Gray
Write-Host "in C:\Program Files (x86)\WinSCP\ if WinSCP is installed normally." -ForegroundColor Gray
Write-Host ""
$winscpDll = Read-Answer "Full path to WinSCPnet.dll" $null
if (-not (Test-Path $winscpDll)) {
Write-Host "Nothing at that path." -ForegroundColor Red
exit 1
}
}
Write-Host ""
Write-Host "Using $winscpDll" -ForegroundColor DarkGray
# Windows tags files copied from elsewhere as untrusted, which stops Add-Type
# loading them. Harmless everywhere else, so failure here is not worth a word.
try {
Get-ChildItem -Path (Split-Path -Parent $winscpDll) -Recurse -File -ErrorAction SilentlyContinue |
Unblock-File -ErrorAction SilentlyContinue Unblock-File -ErrorAction SilentlyContinue
} catch { }
try { try {
Add-Type -Path $winscpDll Add-Type -Path $winscpDll
} catch { } catch {
Write-Host "Could not load WinSCPnet.dll - $($_.Exception.Message)" -ForegroundColor Red Write-Host "Could not load WinSCPnet.dll - $($_.Exception.Message)" -ForegroundColor Red
Write-Host "If it says the operation is not supported, Windows has the file" -ForegroundColor Yellow
Write-Host "blocked: right-click it, Properties, tick Unblock, OK." -ForegroundColor Yellow
exit 1 exit 1
} }
+1 -1
View File
@@ -1 +1 @@
e384719 2026-08-30 per-practice logins + login test 0747612 2026-08-30 standalone login test