Powershell Enter-PSSession for sqlite3.exe fails

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Powershell Enter-PSSession for sqlite3.exe fails

Clinton James
I can run sqlite3.exe on a remote server with a remote desktop connection but when I try using Enter-PSSession, using the same credentials, the sqlite3.exe gives no output and no exitcode. However, if I use the -version option it dutifully reports the version.  I have tried search engines, but seem unable to find an answer for why sqlite3 doesn't appear to run over a session.
Can anyone point me in the right direction, I would like to use a simple console rather than a console within a remote desktop.

Here is the example output after connecting with Enter-PSSession.

[lab-6]: PS C:\...\utilities> dir sqlite*

    Directory: C:\...\utilities

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---         7/22/2019   6:46 PM       6010 sqlite3.def
-a---         7/22/2019   6:46 PM    1902080 sqlite3.dll
-a---         7/22/2019   6:36 PM     947712 sqlite3.exe
-a---         7/22/2019   6:36 PM    2014208 sqlite3_analyzer.exe

[lab-6]: PS C:\swimage\release\utilities> .\sqlite3.exe -version
3.29.0 2019-07-10 17:32:03 fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88bfa6
[lab-6]: PS C:\...\utilities> .\sqlite3.exe dummy.db
[lab-6]: PS C:\...\utilities> $LastExitCode
0

Here is the same when using Powershell through remote desktop connection.

PS C:\...\utilities> .\sqlite3.exe -version
3.29.0 2019-07-10 17:32:03 fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88bfa6
PS C:\...\utilities> .\sqlite3.exe dummy.db
SQLite version 3.29.0 2019-07-10 17:32:03
Enter ".help" for usage hints.
sqlite> .q
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Powershell Enter-PSSession for sqlite3.exe fails

Jose Isaias Cabrera-4


Clinton James, on Thursday, August 8, 2019 11:47 AM, wrote...
>
> [lab-6]: PS C:\swimage\release\utilities> .\sqlite3.exe -version
> 3.29.0 2019-07-10 17:32:03 fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88bfa6
> [lab-6]: PS C:\...\utilities> .\sqlite3.exe dummy.db
> [lab-6]: PS C:\...\utilities> $LastExitCode
> 0
This is the wrong behaviour.  What you are doing is opening the SQlite3 tool to create a db call dummy.db, and write stuff to it.  Once you are done, you would close it and you have a db with stuff on it. Or not, if you didn't do anything.

> Here is the same when using Powershell through remote desktop connection.
>
> PS C:\...\utilities> .\sqlite3.exe -version
> 3.29.0 2019-07-10 17:32:03 fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88bfa6
> PS C:\...\utilities> .\sqlite3.exe dummy.db
> SQLite version 3.29.0 2019-07-10 17:32:03
> Enter ".help" for usage hints.
> sqlite> .q
This is the correct behaviour.  this is what I get when I try it right from my machine:
PS C:\D\bin> ./sqlite3 -version
3.29.0 2019-07-10 17:32:03 fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88bfa6
PS C:\D\bin> .\sqlite3 test.db
SQLite version 3.29.0 2019-07-10 17:32:03
Enter ".help" for usage hints.
sqlite> .q
PS C:\D\bin> $LastExitCode
0

Maybe I am misunderstanding something.  Which has happened before in my life...

josé
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Powershell Enter-PSSession for sqlite3.exe fails

Clinton James
In reply to this post by Clinton James
You are right, it is the wrong behavior though the command is perfectly valid.  My first example shows the current problem, sqlite3.exe does not bring me into an interactive shell.  I am trying to get the correct behavior while using Powershell Enter-PSSession to access a remote machine and the sqlite database on that machine.

Do you experience the same wrong behavior when you access a remote machine and then attempt to use sqlite3 on that remote machine?
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Powershell Enter-PSSession for sqlite3.exe fails

Keith Medcalf
In reply to this post by Clinton James

Maybe WinRM does not know how to run Windows Console programs remotely.  I suspect that it may very well be firing up the executable (ie, is running the executable), it just does not know how to remote the console I/O ...

--
The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume.

>-----Original Message-----
>From: sqlite-users [mailto:sqlite-users-
>[hidden email]] On Behalf Of Clinton James
>Sent: Thursday, 8 August, 2019 09:48
>To: [hidden email]
>Subject: [sqlite] Powershell Enter-PSSession for sqlite3.exe fails
>
>I can run sqlite3.exe on a remote server with a remote desktop
>connection but when I try using Enter-PSSession, using the same
>credentials, the sqlite3.exe gives no output and no exitcode.
>However, if I use the -version option it dutifully reports the
>version.  I have tried search engines, but seem unable to find an
>answer for why sqlite3 doesn't appear to run over a session.
>Can anyone point me in the right direction, I would like to use a
>simple console rather than a console within a remote desktop.
>
>Here is the example output after connecting with Enter-PSSession.
>
>[lab-6]: PS C:\...\utilities> dir sqlite*
>
>    Directory: C:\...\utilities
>
>Mode                LastWriteTime     Length Name
>----                -------------     ------ ----
>-a---         7/22/2019   6:46 PM       6010 sqlite3.def
>-a---         7/22/2019   6:46 PM    1902080 sqlite3.dll
>-a---         7/22/2019   6:36 PM     947712 sqlite3.exe
>-a---         7/22/2019   6:36 PM    2014208 sqlite3_analyzer.exe
>
>[lab-6]: PS C:\swimage\release\utilities> .\sqlite3.exe -version
>3.29.0 2019-07-10 17:32:03
>fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88bfa6
>[lab-6]: PS C:\...\utilities> .\sqlite3.exe dummy.db
>[lab-6]: PS C:\...\utilities> $LastExitCode
>0
>
>Here is the same when using Powershell through remote desktop
>connection.
>
>PS C:\...\utilities> .\sqlite3.exe -version
>3.29.0 2019-07-10 17:32:03
>fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88bfa6
>PS C:\...\utilities> .\sqlite3.exe dummy.db
>SQLite version 3.29.0 2019-07-10 17:32:03
>Enter ".help" for usage hints.
>sqlite> .q
>_______________________________________________
>sqlite-users mailing list
>[hidden email]
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Powershell Enter-PSSession for sqlite3.exe fails

Jose Isaias Cabrera-4
In reply to this post by Clinton James

Clinton James, on Friday, August 9, 2019 04:33 PM, wrote...
>
> You are right, it is the wrong behavior though the command is perfectly valid.
> My first example shows the current problem, sqlite3.exe does not bring me into an
> interactive shell.  I am trying to get the correct behavior while using Powershell
> Enter-PSSession to access a remote machine and the sqlite database on that machine.
>
> Do you experience the same wrong behavior when you access a remote machine and then
> attempt to use sqlite3 on that remote machine?

Sorry for the tardiness in response.  I didn't try to access a remote machine.  I just wanted to let you know that what you thought was wrong, was right. :-)

josé
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users