Skip to content

Debugger is not showing various properties in variable panel #4314

Closed
@AlexHimself

Description

@AlexHimself

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed 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

When debugging PowerShell relating to the PnP-SharePoint module and reviewing variables in the debugger, not all properties are being displayed.

Using the below code (see screenshot), the various properties are missing. This happens with other PS SharePoint objects as well.

I would expect at a minimum to see $item.Name visible in the debugger.

$siteURL = "https://MyOrg.sharepoint.com/sites/MyTeamSite"

Connect-PnPOnline -Url $siteURL -UseWebLogin

Get-PnPFolderItem -FolderSiteRelativeUrl "/Shared Documents" -ItemType File | ForEach-Object {
    $item = $_
    $item.Name # Set breakpoint here
}

Also $item | Get-Member -MemberType Properties -Name "Name" or even $item | Get-Member both return various properties not exposed by the debugger.

Similarly, even commands like Get-ChildItem aren't showing properties? See screenshot.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.3.0
PSEdition                      Core
GitCommitId                    7.3.0
OS                             Microsoft Windows 10.0.19044
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

code --version
1.74.0
5235c6bb189b60b01b1f49062f4ffa42384f8c91
x64

Extension Version

code --list-extensions --show-versions | Select-String powershell

ms-vscode.powershell@2022.11.0

Steps to Reproduce

  1. Add files to a document library or the Share Document library
  2. Change $siteURL to your SharePoint site
  3. Change -FolderSiteRelativeUrl to your document library that contains some files
  4. Set breakpoint on $item.Name and examine the debugger for the local variable $item and expand the node.
  5. Issue: After expanding the node, you should not see various properties such as Name

Visuals

image

image

Logs

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions