I provide a little code snippet for copy/paste:
Thank you!
edited: if you need some list just write which one (operators, built-in variables, ...)
Code: Select all
<#
.synopsis
it would be nice if the documentation keywords were highlighted
.description
xyz
#>
function Verb-Noun
{
[CmdletBinding()] # attribute not highlighted
param
(
# not highlighted types
[int32] $i32,
[int64] $i64,
[Parameter(ValueFromPipeline = $true)] # attribute not highlighted
[hashtable] $ht,
[switch] $sw, # probably the "switch" is highlighted as keyword not as type
[SupportsWildcards()] # attribute not highlighted
# ok highlighted types
[string] $str,
[int] $ii,
[bool] $b
)
# typecasting [...]
# like in the param() section: [typename]
# maybe highlighting the typename ...
$arrlst = [System.Collections.ArrayList] @()
# number specials (the SI standard KiB MiB ...)
# <number><kb | mb | gb | tb | pb>
$n = 1kb * 1mb
$nn = 1024 * 1048576 # $nn equals $n
# builtin variables not highlighted as special variables (it would be nice)
# some exmaples
$h = $host ; $e = $error ; $o = $ofs ; $oe = $outputencoding
$bt = $true ; $bf = $false ; $n = $null
# variable names can contain scope reference in the form of $scope:varname
# the scope can be: global local script private
# or an integer which is >=0
$var1 = $global:error
$var2 = $script:somevarname
$var3 = $1:parentscopevar
# not highlighted operators
$s = "{0}" -f $var1
if (-not ($a -or $b) -and ($c -or $d))
{
$aa = $bb -split ','
}
}