From f80dffcb7cb50711792786b46c600099f8970c9c Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Tue, 24 Jul 2018 09:09:55 -0700 Subject: [PATCH] Stop Diagnostic logging from logging to stdio when the communication protocol is set to stdio --- module/PowerShellEditorServices/Start-EditorServices.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/PowerShellEditorServices/Start-EditorServices.ps1 b/module/PowerShellEditorServices/Start-EditorServices.ps1 index 4473f4b34..078289283 100644 --- a/module/PowerShellEditorServices/Start-EditorServices.ps1 +++ b/module/PowerShellEditorServices/Start-EditorServices.ps1 @@ -78,10 +78,12 @@ param( $DEFAULT_USER_MODE = "600" if ($LogLevel -eq "Diagnostic") { - $VerbosePreference = 'Continue' + if (!$Stdio.IsPresent) { + $VerbosePreference = 'Continue' + } $scriptName = [System.IO.Path]::GetFileNameWithoutExtension($MyInvocation.MyCommand.Name) $logFileName = [System.IO.Path]::GetFileName($LogPath) - Start-Transcript (Join-Path (Split-Path $LogPath -Parent) "$scriptName-$logFileName") -Force + Start-Transcript (Join-Path (Split-Path $LogPath -Parent) "$scriptName-$logFileName") -Force | Out-Null } function LogSection([string]$msg) {