简体   繁体   English

Powershell 在 Visual Studio Code 中调试:Watch for Hashtable 不显示有用信息

[英]Powershell debugging in Visual Studio Code: Watch for Hashtable does not show useful info

I'm using Visual Studio Code to debug a Powershell script.我正在使用 Visual Studio Code 调试 Powershell 脚本。 I have a Hashtable object called $SCRIPT:studentInfo.我有一个名为 $SCRIPT:studentInfo 的哈希表 object。 When I add a Watch for this Hashtable in the Debugger, I find that the Watch doesn't display any useful information.当我在 Debugger 中为这个 Hashtable 添加一个 Watch 时,我发现该 Watch 没有显示任何有用的信息。 Variable Watch 只显示对象类型,不显示内容。

Is there any efficient method to get useful information about the entire contents of a Hashtable while I am debugging?在调试时是否有任何有效的方法来获取有关哈希表全部内容的有用信息?

Thank you.谢谢你。

Question was answered by Daniel in the comments: Remove the SCRIPT scope qualifier (ie. watch '$studentInfo' instead of '$SCRIPT:studentInfo') and the Watch displays contents of the Hashtable as expected. Daniel 在评论中回答了这个问题:删除 SCRIPT scope 限定符(即 watch '$studentInfo' 而不是 '$SCRIPT:studentInfo'),Watch 会按预期显示 Hashtable 的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM