Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

interactive powershell from Cygwin

I cannot run PowerShell.exe interactively in a Cygwin rxvt or mintty terminal. Seems any session using a /dev/tty? or /dev/pts? pseudo terminal device. An instance using the junky windows console device /dev/console or /dev/cons? will work.

cygstart /bin/bash -li

launches the console version in the cruddy Windows Command Prompt which is the only place I can get an interactive PowerShell.

Console

Works. Rxvt doesnt: rxvt

Nor does mintty: mintty

I've tried all the echo -e | powershell.exe and powershell.exe </dev/null

I'm assuming when I see answers on Stackoverflow on this they are using Console's ... or am I missing something?

Why I cannot run PowerShell 2 from Cygwin? seems to run fine, just gets powershell v3 when he wants v2 ... wish I had that problem.


I've developed a powershell wrapper to call powershell scripts and commands from a Cygwin terminal session but cannot get the interactive option to work (if you give the wrapper no script or commands then you want to go interactive). see https://bitbucket.org/jbianchi/powershell/wiki/ for info on the wrapper script. It works for most powershell.exe calls and even acts like a "she-bang" if used in the first line of the ps1 script.

like image 936
johnnyB Avatar asked Oct 20 '22 22:10

johnnyB


1 Answers

Today, typing powershell at a Cygwin bash prompt just works.

like image 62
skiphoppy Avatar answered Oct 24 '22 00:10

skiphoppy