@@ -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,39 @@ 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+
239+ - match : ' @"'
240+ scope : meta.string.interpolated.powershell string.quoted.double.powershell punctuation.definition.string.begin.powershell
241+ embed : scope:source.cs
242+ embed_scope : meta.string.interpolated.powershell string.quoted.double.powershell source.cs.embedded
243+ escape : ("@)
244+ escape_captures :
245+ 1 : meta.string.powershell string.quoted.double.powershell punctuation.definition.string.end.powershell
246+
247+ - match : " @'"
248+ scope : meta.string.powershell string.quoted.single.powershell punctuation.definition.string.begin.powershell
249+ embed : scope:source.cs
250+ embed_scope : meta.string.powershell string.quoted.single.powershell source.cs.embedded
251+ escape : ('@)
252+ escape_captures :
253+ 1 : meta.string.powershell string.quoted.single.powershell punctuation.definition.string.end.powershell
254+
255+ - include : expressions
256+
228257# ##[ USINGS ]##################################################################
229258
230259 using-directives :
0 commit comments