@@ -5,28 +5,34 @@ Write-FormatView -AsControl -Name "PSToken" -TypeName "n/a" -Action {
55 $token = $_
66 $prevEnd = $_.PreviousToken.Start + $_.PreviousToken.Length
77 $substring = $_.Text.Substring ($prevEnd , $token.Start - $prevEnd )
8- if ($substring ) { $substring } else { ' ' }
8+ if ($substring ) { $substring } else { ' ' }
99 }
1010
1111 Write-FormatViewExpression - If {
1212 $_.Type -eq ' Comment'
1313 } - ForegroundColor Success - Property Content
1414
1515 Write-FormatViewExpression - If {
16- $_.Type -in ' Keyword' , ' String'
16+ $_.Type -in ' Keyword' , ' String' , ' CommandArgument '
1717 } - ForegroundColor Verbose - Property Content
1818
1919 Write-FormatViewExpression - If {
2020 $_.Type -in ' Variable' , ' Command'
21- } - ForegroundColor Warning - ScriptBlock {
22- $_.Content
23- }
21+ } - ForegroundColor Warning - Property Content
22+
23+ Write-FormatViewExpression - If {
24+ $_.Type -in ' CommandParameter'
25+ } - ForegroundColor Magenta - Property Content
2426
2527 Write-FormatViewExpression - If {
2628 $_.Type -in ' Operator' , ' GroupStart' , ' GroupEnd'
27- } - ForegroundColor Blue - Property Content
29+ } - ForegroundColor Magenta - Property Content
2830
2931 Write-FormatViewExpression - If {
30- $_.Type -notin ' Comment' , ' GroupStart' , ' GroupEnd' , ' Variable' , ' Operator' , ' Command' , ' Keyword' , ' String'
32+ $_.Type -notin ' Comment' ,
33+ ' Keyword' , ' String' , ' CommandArgument' ,
34+ ' Variable' , ' Command' ,
35+ ' CommandParameter' ,
36+ ' Operator' , ' GroupStart' , ' GroupEnd'
3137 } - Property Content
3238}
0 commit comments