Skip to content

Debugger not showing all variables while debugging Powershell Code #1389

@rk-h

Description

@rk-h

System Details

  • Operating system name and version: Windows 10 Version 1709
  • VS Code version: 1.24.1 64bit
  • PowerShell extension version: 1.7.0
  • Output from $PSVersionTable:
PSVersion                      5.1.16299.492
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.16299.492
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Copy / paste the following commands into the PowerShell Integrated Console, and paste the output here:

1.24.1
24f62626b222e9a8313213fb64b10d741a326288
x64

Major  Minor  Build  Revision
-----  -----  -----  --------
1      7      0      0
abusaidm.html-snippets@0.2.1
AdamCaviness.theme-monokai-dark-soda@0.0.5
dbankier.vscode-instant-markdown@1.4.1
ecmel.vscode-html-css@0.2.0
EditorConfig.EditorConfig@0.12.4
formulahendry.code-runner@0.9.3
haaaad.ansible@0.2.8
hdg.live-html-previewer@0.3.0
HookyQR.beautify@1.3.2
humy2833.ftp-simple@0.6.7
Kasik96.format-indent@1.3.0
magicstack.MagicPython@1.0.12
marcostazi.VS-code-vagrantfile@0.0.7
mkaufman.HTMLHint@0.5.0
ms-python.python@2018.6.0
ms-vscode.PowerShell@1.7.0
msazurermtools.azurerm-vscode-tools@0.4.2
msjsdiag.debugger-for-chrome@4.7.0
ritwickdey.LiveServer@5.1.1
searKing.preview-vscode@1.4.2
xabikos.JavaScriptSnippets@1.7.0
zhuangtongfa.Material-theme@2.14.1
Zignd.html-css-class-completion@1.17.1

Key   : PSVersion
Value : 5.1.16299.492
Name  : PSVersion


Key   : PSEdition
Value : Desktop
Name  : PSEdition


Key   : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0...}
Name  : PSCompatibleVersions


Key   : BuildVersion
Value : 10.0.16299.492
Name  : BuildVersion


Key   : CLRVersion
Value : 4.0.30319.42000
Name  : CLRVersion


Key   : WSManStackVersion
Value : 3.0
Name  : WSManStackVersion


Key   : PSRemotingProtocolVersion
Value : 2.3
Name  : PSRemotingProtocolVersion


Key   : SerializationVersion
Value : 1.1.0.1
Name  : SerializationVersion

Issue Description

Debugger is not debugging / showing all Variables or array members.

Example:

The code I run

$UserMailboxStats = Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited "john.doe@contoso.com" | Get-MailboxStatistics 

This is what the debugging windows shows when debugging a .ps1 file.
The var in question is $UserMailboxStats

Screenshot: https://i.imgur.com/y6iReCR.png

And this is what the command '$UserMailboxStats | fl' prints out when executed within the same debugging session (output is cut off for security / privacy reasons):

[DBG]: PS C:\Users\x\y\z\powershell> $UserMailboxStats | fl


RunspaceId                                     : f
TotalItemSizeInBytes                           : 1
MoveHistory                                    :
AssociatedItemCount                            : 2
DeletedItemCount                               : 2
ItemCount                                      : 3
TotalDeletedItemSize                           : 1
TotalItemSize                                  : 1
MessageTableTotalSize                          : 6
MessageTableAvailableSize                      : 1
AttachmentTableTotalSize                       : 1
AttachmentTableAvailableSize                   : 1
OtherTablesTotalSize                           : 2
OtherTablesAvailableSize                       : 1
IsEncrypted                                    : F
DataEncryptionPolicyId                         :
KeyVersionIDs                                  :
AdvancedDataEncryptionDetails                  :
CurrentSchemaVersion                           : 0
DisconnectDate                                 :
DisconnectReason                               :
DisplayName                                    : W
LastLoggedOnUserAccount                        :
LastLogoffTime                                 : 2
LastLogonTime                                  : 2
LegacyDN                                       : /
MailboxGuid                                    : d
OwnerADGuid                                    : 8
MailboxType                                    : P
MailboxTypeDetail                              : U
ObjectClass                                    : U
StorageLimitStatus                             :
MailboxTableIdentifier                         :
Database                                       : E
ServerName                                     : H
DatabaseName                                   : E
IsDatabaseCopyActive                           : T
IsClutterEnabled                               : F
IsQuarantined                                  : F
QuarantineClients                              :
QuarantineDescription                          :
QuarantineLastCrash                            :
QuarantineEnd                                  :
QuarantineFileVersion                          :
IsAbandonedMoveDestination                     : F
ExternalDirectoryOrganizationId                : 8
IsArchiveMailbox                               : F
IsMoveDestination                              : F
MailboxMessagesPerFolderCountWarningQuota      : 9
MailboxMessagesPerFolderCountReceiveQuota      : 1
DumpsterMessagesPerFolderCountWarningQuota     : 2
DumpsterMessagesPerFolderCountReceiveQuota     : 3
FolderHierarchyChildrenCountWarningQuota       : 9
FolderHierarchyChildrenCountReceiveQuota       : 1
FolderHierarchyDepthWarningQuota               : 2
FolderHierarchyDepthReceiveQuota               : 3
FoldersCountWarningQuota                       : 2
FoldersCountReceiveQuota                       : 2
NamedPropertiesCountQuota                      : 1
SystemMessageSize                              : 1
SystemMessageCount                             : 7
SystemMessageSizeWarningQuota                  : 2
SystemMessageSizeShutoffQuota                  : 2
FastIsEnabled                                  : F
BigFunnelIsEnabled                             : T
BigFunnelUpgradeInProgress                     : F
BigFunnelMaintainRefiners                      : T
BigFunnelFilterTableTotalSize                  : 2
BigFunnelFilterTableAvailableSize              : 9
BigFunnelPostingListTableTotalSize             : 1
BigFunnelPostingListTableAvailableSize         : 8
BigFunnelLargePOITableTotalSize                : 4
BigFunnelLargePOITableAvailableSize            : 2
BigFunnelTotalPOISize                          : 6
BigFunnelMessageCount                          : 3
BigFunnelIndexedSize                           : 1
BigFunnelPartiallyIndexedSize                  : 5
BigFunnelNotIndexedSize                        : U
BigFunnelCorruptedSize                         : 0
BigFunnelStaleSize                             : 1
BigFunnelShouldNotBeIndexedSize                : 1
BigFunnelIndexedCount                          : 3
BigFunnelPartiallyIndexedCount                 : 2
BigFunnelNotIndexedCount                       : 0
BigFunnelCorruptedCount                        : 0
BigFunnelStaleCount                            : 1
BigFunnelShouldNotBeIndexedCount               : 6
BigFunnelMailboxCreationVersion                : 0
DatabaseIssueWarningQuota                      : 4
DatabaseProhibitSendQuota                      : 5
DatabaseProhibitSendReceiveQuota               : 5
ResourceUsageRollingAvgRop                     : 1
ResourceUsageRollingAvgDatabaseReads           : 9
ResourceUsageRollingClientTypes                : 9
NeedsToMove                                    : N
MCDBMessageTableTotalSize                      : 1
MCDBMessageTableAvailableSize                  : 9
MCDBMessageTablePercentReplicated              : 1
MCDBOtherTablesTotalSize                       : 0
MCDBOtherTablesAvailableSize                   : 0
MCDBBigFunnelFilterTableTotalSize              : 2
MCDBBigFunnelFilterTableAvailableSize          : 3
MCDBBigFunnelFilterTablePercentReplicated      : 1
MCDBBigFunnelLargePOITableTotalSize            : 5
MCDBBigFunnelLargePOITableAvailableSize        : 1
MCDBBigFunnelLargePOITablePercentReplicated    : 1
MCDBBigFunnelPostingListTableTotalSize         : 7
MCDBBigFunnelPostingListTableAvailableSize     : 6
MCDBBigFunnelPostingListTablePercentReplicated : 1
Identity                                       : d
Identity                                       : d
d7aa                                              
7
Identity                                       : d
d7aa
7aa7
Identity                                       : d             
OriginatingServer                              : h             
ObjectState                                    : U

Expectation: To see all of the above attributes within the debugger view under 'Variables'. As in the Powershell ISE with ISESteroids add-on. Screenshot: https://i.imgur.com/Y5fej6m.png

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions