Skip to content

PowerShell preview extension does not allow running selection from undefined files  #2137

Closed
@Glober777

Description

@Glober777

Issue Description

I've noticed that every time I create a new file (without saving it), set it as PowerShell, add in some code, select a fraction (or all of it), followed by pressing F8 I get a notification saying: Cannot read property 'name' of undefined:
image

image

Running selection with F8 starts to work only after I run the whole thing with first (F5).

This is not how it works in ISE.

Attached Logs

Couldn't find anything related in the logs. Please let me know if those are needed.

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.17763
VSCode 1.37.0
PowerShell Extension Version 2019.5.0

PowerShell Information

Name Value
PSVersion 5.1.17763.503
PSEdition Desktop
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.17763.503
BuildVersion 10.0.17763.503
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
azure-account ms-vscode 0.8.4
azure-pipelines ms-azure-devops 1.155.0
beautify HookyQR 1.5.0
code-settings-sync Shan 3.4.1
code-spell-checker streetsidesoftware 1.7.17
csharp ms-vscode 1.21.0
docs-article-templates docsmsft 0.2.7
docs-authoring-pack docsmsft 0.1.2
docs-markdown docsmsft 0.2.13
docs-preview docsmsft 0.3.25
docs-yaml docsmsft 0.2.3
ecdc mitchdenny 1.3.0
EditorConfig EditorConfig 0.13.0
gc-excelviewer GrapeCity 2.1.32
gitlens eamodio 9.9.3
live-html-previewer hdg 0.3.0
mssql ms-mssql 1.6.0
partial-diff ryu1kn 1.4.0
pomodoro-code odonno 0.2.1
powershell-preview ms-vscode 2019.5.0
team ms-vsts 1.149.2
theme-hackershaze Nuuf 2.0.1
todo-tree Gruntfuggly 0.0.141
vscode-hexdump slevesque 1.7.2
vscode-logicapps ms-azuretools 0.2.9
vscode-markdownlint DavidAnson 0.30.1
vscode-yaml redhat 0.4.1
xml DotJoshJohnson 2.5.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions