Reporting SQLite3 script errors to PowerShell
(1) By TomEggers on 2022-07-31 00:02:20 [source]
I'm using PowerShell to run an SQLite3 script: Get-Content $script | sqlite3.exe; The script has an error in it that should get reported to PowerShell. How does the PS code determine that there was an SQLite3 error? Will $LastExitCode get set to non-zero? Is there a better way?
Versions: PowerShell v5 with $ErrorActionPreference = "Stop"; SQLite3 v3380500 with ".bail on" in the script.
(2) By Larry Brasfield (larrybr) on 2022-07-31 00:52:22 in reply to 1 [link] [source]
When run with the invocation, "sqlite3 -bail -batch", an error condition will result in a non-zero process exit code. In PowerShell, that will affect the value of $LastExitCode if it is read soon enough.