question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't run powershell.exe from within a Bash/WSL session

See original GitHub issue

Cannot run powershell.exe from within a Windows Subsystem for Linux Bash session nor from within a Tmux session!:

Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 0 Keys:


Exception:
System.IO.IOException: The handle is invalid.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Console.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
   at Microsoft.PowerShell.Internal.ConhostConsole.get_CursorLeft()
   at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------

Edge case, I know, but a user asked!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
bitcrazedcommented, Dec 16, 2016

Invoking Windows PowerShell.exe from within Linux Bash! 😃

$ powershell.exe
1reaction
villesinisalocommented, May 17, 2017
user@hostname:~$ powershell.exe
Unable to translate current working directory. Using C:\Users\user
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS C:\Users\user> Exit
Exit
user@hostname:~$ 

Seems to work for me now 🤷‍♂️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use Powershell in WSL - windows subsystem for linux
No, you can't run "WSL" in a "PowerShell terminal" because there's no such thing as a "PowerShell terminal" (see below). Some shell ......
Read more >
How to run PowerShell.exe command from bash as root in ...
When running as root , $PATH contains only a minimal set of entries that doesn't include Windows file-system directories such as the one ......
Read more >
Troubleshooting Windows Subsystem for Linux
To enable WSL run this command in a PowerShell prompt with admin privileges: Enable-WindowsOptionalFeature -Online -FeatureName ...
Read more >
The Ultimate Guide to Windows Subsystem for Linux ...
Learn how to natively work within Linux on Windows 10 with Windows Subsystem for Linux (WSL in Windows) in this HUGE guide!
Read more >
cmd.exe vs PowerShell vs WSL Ubuntu command line
Hi all, As much as I'd like to run straight linux and be done with it, the driver station and other utilities don't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found