Score:0

GIT-SCM bash.exe doesn't work from "Enter-PSSession -Computer myServer"?

jm flag

Let's suppose I download and install Git-SCM on a remote windows 10 computer using this installer:

https://github.com/git-for-windows/git/releases/download/v2.33.1.windows.1/PortableGit-2.33.1-64-bit.7z.exe

I unzip this exe installation file to the directory C:\GitPortable on the computer myserver. Which means on this computer I can start bash from powershell by typing:

PS> $env:path = "C:\PortableGit\usr\bin;$env:path"

PS> bash
dude@myserver ~
$ 
$ # now i'm at a BASH shell prompt!

Now, for my problem. I want to Enter-PSSession from another computer on my network, and start BASH shell from the remote interactive powershell session. But, it doesn't work even though bash.exe is a command line program. Example:

PS> Enter-PSSession -Computer MyServer

[myServer]: PS>  $env:path = "C:\PortableGit\usr\bin;$env:path"

[myServer]: PS>  bash
<NO OUTPUT HERE?>

[myServer]: PS>  cd C:\PortableGit\usr\bin

[myServer]: PS>  dir bash.exe

-a----         8/24/2021   6:24 AM        1963639 bash.exe

[myServer]: PS>  .\bash.exe
<NO OUTPUT HERE?>
[myServer]: PS>

However, bash works if I put "--help":

[myServer]: PS> bash --help
GNU bash, version 4.4.23(1)-release-(x86_64-pc-msys)
Usage:  /usr/bin/bash [GNU long option] [option] ...
        /usr/bin/bash [GNU long option] [option] script-file ...
GNU long options:
        --debug
        --debugger
        --dump-po-strings
        ...

I really needed to interactive bash shell from Enter-PSSession to work.. are their any work arounds to get an interactive bash shell to work remotely?

pico avatar
jm flag
The Git developers said that you potentially need to use winpty, so instead of "[myserver]: PS> bash", it would be "[myserver]: PS> winpty bash --login --interactive." Unfortunately, this gives the error message. "winpty : stdin is not a tty + CategoryInfo : NotSpecified: (stdin is not a tty:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError"
pico avatar
jm flag
https://stackoverflow.com/questions/48199794/winpty-and-git-bash
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.