Skip to content

Commit 6f76c6e

Browse files
eitamalJustinGrote
andauthored
Add missing MEL log levels to the LogLevel validation (#2235) (#2236)
* Add missing MEL log levels to the LogLevel parameter in Start-EditorServices.ps1 (#2235) This commit adds `Trace`, `Debug`, `Information`, `Critical`, and `None` to the validation set on the `LogLevel` parameter when starting PSES using `Start-EditorServices.ps1` to allow for the adoption of the newer MEL log levels. * Add legacy log level translations --------- Co-authored-by: Justin Grote <[email protected]>
1 parent bdd85ec commit 6f76c6e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

module/PowerShellEditorServices/Start-EditorServices.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ param(
4646
[ValidateNotNullOrEmpty()]
4747
$LogPath,
4848

49-
[ValidateSet("Diagnostic", "Verbose", "Normal", "Warning", "Error")]
49+
[ValidateSet("Diagnostic", "Verbose", "Normal", "Warning", "Error", "Trace", "Debug", "Information", "Critical", "None")]
5050
$LogLevel,
5151

5252
[ValidateNotNullOrEmpty()]
@@ -107,5 +107,13 @@ param(
107107
$DebugServiceOutPipeName
108108
)
109109

110+
#Translate legacy PSES log levels to MEL levels
111+
$LogLevel = switch ($LogLevel) {
112+
'Diagnostic' { 'Trace' }
113+
'Verbose' { 'Debug' }
114+
'Normal' { 'Information' }
115+
default { $LogLevel }
116+
}
117+
110118
Import-Module -Name "$PSScriptRoot/PowerShellEditorServices.psd1"
111119
Start-EditorServices @PSBoundParameters

0 commit comments

Comments
 (0)