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.

Errors in Integrated Console when invoking some native applications (PSHostRawUserInterface)

See original GitHub issue

System Details

  • Operating system name and version: Windows 10 Insider 16232
  • VS Code version: 1.14.1
  • PowerShell extension version: 1.4.1
  • Output from $PSVersionTable: Name Value

PSVersion 5.1.16232.1000 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} BuildVersion 10.0.16232.1000 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

Copy / paste the below commands into the PowerShell Integrated Terminal, and paste the output here

code -v
$pseditor.EditorServicesVersion
code --list-extensions --show-versions
$PSVersionTable

Issue Description

In VSCode Integrated Terminal when using “Start-Transcript”, external commands (e.g. git.exe/ipconfig/nbtstat/etc/etc/etc) run as expected, but on completion a spurious error message is displayed.

This occurs if Start-Transcript is entered manually into the integrated console or if Start-Transcript is included in Profile.ps1. The error does not occur if transcripts are not being collected (or if Stop-Transcript is used).

The issue only occurs with external (.exe/.com etc) commands. Cmdlets do not cause a problem.

(I have tested with no profile scripts to eliminate anything in my profile)

More info available on request…

Attached Logs

#Example

PS C:\Data\Git> Start-Transcript -OutputDirectory ‘C:\Data’ PS C:\Data\Git> PS C:\Data\Git> arp /?

Displays and modifies the IP-to-Physical address translation tables used by <…snip…>

arp -a … Displays the arp table. Program ‘ARP.EXE’ failed to run: The method or operation is not implemented.At line:1 char:1

  • arp /?

At line:1 char:1

  • arp /?
  •   + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
      + FullyQualifiedErrorId : NativeCommandFailed
    
    

PS C:\Data\Git>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
daviwilcommented, Sep 7, 2017

@dlwyatt Thanks Dave! I don’t know why I didn’t look at the call stack and actually figure out why this was happening. Looks like if I implement the method enough to satisfy this code the problem should go away:

https://github.com/PowerShell/PowerShell/blob/7c9b188c135ed001093641698d48a22fd016f6ab/src/System.Management.Automation/engine/NativeCommandProcessor.cs#L713

I’ll try to throw that in with the next Editor Services update.

0reactions
BladeFireLightcommented, Sep 27, 2017

I looking forward to this fix. We have transcription on via Policy also. right now any try/catch with a native command fails 100% of the time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when calling 3rd party executable from Powershell when ...
If the I/O stream is not redirected on console host, PowerShell gives the native EXE a console handle to write to directly. This...
Read more >
Acquiring console logs on MAC for native apps
Open the Console application (from the Utilities folder inside your Applications folder) OR use CMD+SPACE command search CONSOLE mceclip0.
Read more >
VPP errors when syncing with Workspace ONE (2960900)
Admin is unable to install VPP apps to devices from Workspace ONE UEM Console (while using User Based VPP). VPP applications are not...
Read more >
Reviewing React Native console logs: Best practices
When it comes to debugging, console logs are really insightful, helping you examine the real-time data that an app is using at any...
Read more >
Application Insights for console applications - Azure Monitor
Telemetry isn't sent instantly. Items are batched and sent by the ApplicationInsights SDK. Console apps exit after calling Track() methods.
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