@@ -137,7 +137,9 @@ contexts:
137137 - include : pop-before-eol
138138
139139 - include : operators
140+ - include : parameters
140141
142+ parameters :
141143 # Flags/Options/Parameters
142144 - match : \B(--?|[/+])\p{L}(?:[\w-]*\w)?
143145 scope : variable.parameter.option.powershell
@@ -201,6 +203,7 @@ contexts:
201203# ##[ COMMANDS ]################################################################
202204
203205 commands :
206+ - include : commands-add-type
204207 - include : commands-verb-noun
205208 - include : commands-reserved
206209 - include : script-invocation
@@ -218,13 +221,36 @@ contexts:
218221
219222 commands-reserved :
220223 # Builtin cmdlets with reserved verbs
221- - match : \b(?i:(?:foreach|where|sort|tee)-object )\b
224+ - match : \b(?i:(?:ForEach|Where|Sort|Tee)-Object )\b
222225 scope : support.function.powershell
223226
224227 script-invocation :
225228 - match : \b[\w.\\/-]+\.(?i:exe|com|cmd|bat|ps1)\b
226229 scope : variable.function.powershell
227230
231+ commands-add-type :
232+ - match : \b(?i:Add-Type)\b
233+ scope : support.function.powershell
234+ push : inside-add-type
235+
236+ inside-add-type :
237+ - include : pop-eol
238+ - match : ' @"'
239+ scope : meta.string.interpolated.powershell string.quoted.double.powershell punctuation.definition.string.begin.powershell
240+ embed : scope:source.cs
241+ embed_scope : meta.string.interpolated.powershell string.quoted.double.powershell source.cs.embedded
242+ escape : ("@)
243+ escape_captures :
244+ 1 : meta.string.powershell string.quoted.single.powershell punctuation.definition.string.end.powershell
245+ - match : " @'"
246+ scope : meta.string.powershell string.quoted.single.powershell punctuation.definition.string.begin.powershell
247+ embed : scope:source.cs
248+ embed_scope : meta.string.powershell string.quoted.single.powershell source.cs.embedded
249+ escape : ('@)
250+ escape_captures :
251+ 1 : meta.string.powershell string.quoted.single.powershell punctuation.definition.string.end.powershell
252+ - include : expressions
253+
228254# ##[ USINGS ]##################################################################
229255
230256 using-directives :
0 commit comments