Skip to content

Not in file Scriptblock debugging create empty temporary file #3904

Closed
PowerShell/PowerShellEditorServices
#2064
@ili101

Description

@ili101

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.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

On stable a temporary file is created with the content of the scriptblock and debugged normally.
On preview temporary empty file is created.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.2.2
PSEdition                      Core
GitCommitId                    7.2.2
OS                             Microsoft Windows 10.0.22000
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.66.0
e18005f0f1b33c29e81d732535d8c0e47cafb0b5
x64

Extension Version

Steps to Reproduce

$X = {
    Set-PSBreakpoint -Variable Foo
    $Foo = 0
    1
    2
    3
}.ToString()

. ([Scriptblock]::Create($X))

Visuals

image

Logs

No response

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions