Skip to content

F5 on a saved script isn't dot sourcing #3715

Closed
PowerShell/PowerShellEditorServices
#1652
@SeeminglyScience

Description

@SeeminglyScience

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.

Summary

Looks like we're creating a new scope for invocation of script files, leaving any set variables and functions no longer accessible.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.2.0-preview.10
PSEdition                      Core
GitCommitId                    7.2.0-preview.10
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

1.60.0
e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff
x64

Extension Version

ms-vscode.powershell-preview@2021.11.1

Steps to Reproduce

  1. New file
  2. Add $a = 50
  3. Save it
  4. F5
  5. Type $a in the PSIC
  6. See it's not set

Visuals

No response

Logs

No response

Metadata

Metadata

Assignees

Labels

Bug: Pre-releaseBugs reproducing only in the pre-release extension.Issue-BugA bug to squash.

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions