Why is the Edit command not working in a remote PowerShell session?

0
0
Asked By CoolCat2023 On

I'm trying to use the Edit command, which is part of Microsoft's new editor, during a remote PowerShell session. However, when I run the command after entering the session with Enter-PSSession -ComputerName PC1, I get an error: Error 0x80070006: The handle is invalid. Is there any way to make this work, or am I missing something?

3 Answers

Answered By ScriptWizard11 On

Yeah, this is pretty common when using PowerShell’s remoting. No TUI tools will work over it because it doesn't create a TTY environment, just routes inputs and outputs. For example, editors like vim don't work either, so going with SSH is definitely the way to go.

Answered By SearchPro2023 On

It’s literally four letters, man. A quick Google search for "Microsoft edit" would bring it up as the first result. Here’s a link to the GitHub page for it: https://github.com/microsoft/edit. If you're unsure, sometimes it's best just to not comment if you can't help.

Answered By TechSavvy98 On

So, the issue here is that Enter-PSSession doesn't provide a fully interactive console environment, which means applications that require direct console input/output, like Microsoft Edit, won’t function as expected. You might want to look into using SSH instead, as it creates a proper terminal session that supports TUI apps.

GadgetGuru77 -

Exactly this.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.