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.

Register-EditorCommand fails due to ALC changes

See original GitHub issue

Issue Description

I am experiencing a problem with running the below code in the Integrated terminal.

Register-EditorCommand -Name 'RunFileInExternalWindow' -DisplayName 'Run current file in external window' -ScriptBlock { Start-Process pwsh '-File',$psEditor.GetEditorContext().CurrentFile.Path }

Creating as discussed with @SeeminglyScience .

Attached Logs\screenshot

image

Environment Information

Visual Studio Code

Visual Studio Code(Click to Expand)
Name Version
Operating System Windows_NT x64 10.0.18363
VSCode 1.42.1
PowerShell Extension Version 2020.2.0

PowerShell Information

PowerShell Information(Click to Expand)
Name Value
PSVersion 7.0.0-rc.3
PSEdition Core
GitCommitId 7.0.0-rc.3
OS Microsoft Windows 10.0.18363
Platform Win32NT
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.10032.0 6.0.0 6.1.0 6.2.0 7.0.0-rc.3
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
powershell-preview ms-vscode 2020.2.0
remote-wsl ms-vscode-remote 0.42.3

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rjmholtcommented, Feb 26, 2020

I’ll see if I can find a way to attach the PSES assembly to the default ALC properly.

Turns out this isn’t possible, from what I’ve tried.

Ideally we could spin this out into a new assembly which is internally enlightened through the various APIs, but I don’t think we have time for that before the release given the other high-priority bugs we want to address.

This works if we fully-qualify the type names for now, so I’ll do that. Later on I’d like to spin out a separate module for it all. That will be a breaking change, but we’ll do it with consultation and in a way that minimises the exposure to PowerShell. Certainly all the commands will be the same (just not the types).

1reaction
rjmholtcommented, Feb 26, 2020

Ah, I had assumed that loading the PSES asm into the default ALC would work for PowerShell, but I seems that loading it in the resolve event doesn’t make it appear in the default ALC’s assembly list… It happens that the way PowerShell exposes types in 7 has changed since 6.2.

I’ll see if I can find a way to attach the PSES assembly to the default ALC properly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

7 Ways to Fix the Windows Registry Editor When It Won't ...
Type Command Prompt in the Start Menu search bar. Right-click on the Command Prompt option and select Run as administrator. Type the following ......
Read more >
Why can't I edit the system BCD store via regedit? - Super User
Yet, the BCDEDIT command can insert, update and delete items from this store without issues and the changes will show up in the...
Read more >
Jabber for Windows Persistent Registry Keys Prevent Install
This document describes how to resolve a problem that is caused by persistent registry keys when you install or upgrade Cisco Jabber for ......
Read more >
Tensorboard page error: MimeType text/plain is not executable
Open windows registry editor (windows + r → regedit); Go to HKEY_CLASSES_ROOT → .js; Change content type from text/plain to application/ ...
Read more >
The Army Substance Abuse Program
It identifies Army policy on alcohol and other drug abuse, and it identifies as- signed responsibilities for implementing the program.
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