Reduce Integrated Console prompt output/noise while stepping through scripts

オープン
#888 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
powershell, typescript, vscode

調査の方向性

ソースファイルやテストは指定されていません。まず、F11でステップ実行しながらサンプルスクリプトを再現し、Integrated Consoleがプロンプトとブレークポイントメッセージをどのように出力するかを調べてください。デバッグ出力が通常の実行と一致し、"" | out-hostによる意図的な空の出力を保持し、インタラクティブなセッションの変更も引き続き可能であれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Area-Extension Terminal Issue-Enhancement
System Details

Operation system name and version: Windows 8.1 (64-bit)

PS > code -v
1.13.0
376c52b955428d205459bea6619fc161fc8faacf

PS > code --list-extensions --show-versions
ms-vscode.PowerShell@1.3.2

PS > $PSVersionTable

Name Value


PSVersion 5.0.10586.117
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.10586.117
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Issue Description

I'm making the transition from using Quest/Dell's PowerGUI to Visual Studio Code with the vscode-powershell extension. While making this transition, I noticed a significant change in the way the console output behavior while running the debugger and steps through lines of code. When stepping through lines of code in the Visual Studio Code debugger (using F11) my PowerShell terminal returns a PowerShell prompt for every step taken, rather than just showing console output when something within the script's output is sent to the console. This behavior also occurs in PowerShell ISE, but does not occur within PowerGUI while stepping through lines of code. I often perform an "out-host" to display a status message which can be followed by several lines of code prior to the next "out-host" message to be written to the console. In PowerGUI the console window remains uncluttered while stepping through lines of code that don't write console output. I'm finding it difficult using the vscode etension to quickly review my status messages when they are spread apart by several lines of PowerShell prompts.

Could the vscode-powershell extension be modified, or have a configuration option added to it that will suppress the debug console output if only the prompt or a blank line is going to be displayed (but still allow for a blank when "" | out-host is used)? Would it also be possible to have an option to suppress the "Hit Line breakpoint on 'C:\temp\debug-step-test.ps1:1'" from the terminal output? I'd like to keep my terminal output the same whether I'm step debugging or running the script normally.

The desired behavior is that the terminal debug output would match the normal script execution output, while still allowing interaction with the script session (to change an object's property values for example)
between the debug steps.

These are all the behaviors I'm used to with PowerGUI, but am trying to move away from it due to its end of life status. This is the download link for PowerGUI if you would like to see the desired behavior of the console window while stepping through the code:
http://community-downloads.quest.com/powergui/Release/3.8/PowerGUI.3.8.0.129.msi

Thank you so much. I'm really looking forward to using Visual Studio Code with the vscode-powershell extension for writing my PowerShell scripts!

Tyson Flint

Example code to reproduce this issue:


$MyValue = 1
"status message 1" | out-host
for ($count = 1; $count -le 5; $count++)
{
	# Normally, you'd do a bunch of stuff in here
	# The console terminal should allow for changing the following value between debug steps.
	# Copy/Paste this next line in the terminal window while stepping through one iteration of this loop (remove the comment character):
	# $MyValue=10
	$MyValue++
}
"status message 2" | out-host
	
if ($MyValue -le 6)
{
	"You DID NOT modify the MyValue while stepping through the loop. 'MyValue' is: " + $MyValue | out-host
}
else
{
	"You MODIFIED the MyValue while stepping through the loop. 'MyValue' is: " + $MyValue | out-host
}
"" | out-host
"status message 3 - Blank line test. The line above should be blank whether debugging or not." | out-host

Normal script execution output:


status message 1
status message 2
You DID NOT modify the MyValue while stepping through the loop. 'MyValue' is: 6

status message 3 - Blank line test. The line above should be blank whether debugging or not.

Debug stepping through script output (notice it is difficult to find the status message):


Hit Line breakpoint on 'C:\Users\v-tysonf.REDMOND\Documents\Lenel-SQL-Inventory\debug-step-test.ps1:1'

[DBG]: PS C:\temp>
[DBG]: PS C:\temp>
status message 1
[DBG]: PS C:\temp>


[DBG]: PS C:\temp> [DBG]: PS C:\temp>




[DBG]: PS C:\temp> [DBG]: PS C:\temp>


[DBG]: PS C:\temp> [DBG]: PS C:\temp>




[DBG]: PS C:\temp> [DBG]: PS C:\temp>

status message 2


You DID NOT modify the MyValue while stepping through the loop. 'MyValue' is: 6


[DBG]: PS C:\temp> [DBG]: PS C:\temp>
status message 3 - Blank line test. The line above should be blank whether debugging or not.
[DBG]: PS C:\temp>

主要言語
TypeScript
スター
1.9k
フォーク
548
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PowerShell/vscode-powershell のほかの issue

PowerShell/vscode-powershell の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。