I'm trying to launch the popular flashcard app Anki2 on my work laptop that runs Windows 11. Unfortunately the app is unable to connect to the ankiweb.net servers and syncronize my progress with that of my other mobile devices. I've done some digging and tried these two scripts -- only the .bat works, the powershell doesn't, why? Can you give me some pointers please, so that I can fix it?
anki-proxy.bat
:
@echo off &SetLocal DisableDelayedExpansion
set /p USERNAME=<myuser>
set /p PASSWORD=<passwrd>
set "https_proxy=http://<myuser>:<passwrd>@mycompanyproxy-address:9090"
cd "C:\Users\<myuser>\AppData\Local\Programs\Anki"
start anki.exe
pause
anki2-proxy.ps1
:
$proxyCreds=get-credential -username $env:username -message "Please put your Proxy password: "
Set-Variable http_proxy="http://{$proxyCreds.USERNAME}:{$proxyCreds.PASSWORD}@mycompanyproxy-address:9090"
Start "C:\Users\<myuser>\AppData\Local\Programs\Anki\anki.exe"
In the latter case I get the usual:
Error details: error sending request for url (): error trying to connect: tcp connect error
but in the former, the synchronisation works and I'm able to proceed with the learning.