File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ Most lines should begin with one of these words:
1313- Change ` Cmdlet ` , renaming to ` PSqlCmdlet ` .
1414- Remove ` IConsole ` , replacing it with a simpler ` ISqlMessageLogger ` .
1515- Update Microsoft.Data.SqlClient to [ 5.2.2] ( https://github.com/dotnet/SqlClient/blob/main/release-notes/5.2/5.2.2.md )
16+ - Add ` -ReplaceVariablesInComments ` switch to ` Expand-SqlCmdDirectives ` .
1617- Add retries on transient failures.
1718- Fix ` EncryptionMode.Default ` requiring certificate validation for local
1819 connections.
Original file line number Diff line number Diff line change @@ -19,6 +19,13 @@ public SqlCmdPreprocessor()
1919 _preprocessor = new ( ) ;
2020 }
2121
22+ /// <inheritdoc cref="Prequel.SqlCmdPreprocessor.EnableVariableReplacementInComments"/>
23+ public bool EnableVariableReplacementInComments
24+ {
25+ get => _preprocessor . EnableVariableReplacementInComments ;
26+ set => _preprocessor . EnableVariableReplacementInComments = value ;
27+ }
28+
2229 /// <summary>
2330 /// Defines the specified <c>sqlcmd</c> variables.
2431 /// </summary>
Original file line number Diff line number Diff line change @@ -27,6 +27,17 @@ public class ExpandSqlCmdDirectivesCommand : PSqlCmdlet
2727 [ Parameter ( Position = 1 ) ]
2828 public Hashtable ? Define { get ; set ; }
2929
30+ /// <summary>
31+ /// <b>-ReplaceVariablesInComments</b>
32+ /// Perform SQLCMD variable replacement inside SQL comments.
33+ /// </summary>
34+ [ Parameter ]
35+ public SwitchParameter ReplaceVariablesInComments
36+ {
37+ get => _preprocessor . EnableVariableReplacementInComments ;
38+ set => _preprocessor . EnableVariableReplacementInComments = value ;
39+ }
40+
3041 private readonly E . SqlCmdPreprocessor _preprocessor ;
3142
3243 /// <summary>
Original file line number Diff line number Diff line change 222222 <maml : name >Define</maml : name >
223223 <command : parameterValue required =" true" >hashtable</command : parameterValue >
224224 </command : parameter >
225+ <command : parameter required =" false" position =" named" pipelineInput =" False" globbing =" false" >
226+ <maml : name >ReplaceVariablesInComments</maml : name >
227+ </command : parameter >
225228 </command : syntaxItem >
226229 </command : syntax >
227230
251254 <dev : defaultValue >None</dev : defaultValue >
252255 </command : parameter >
253256
257+ <command : parameter required =" false" position =" named" pipelineInput =" False" globbing =" false" aliases =" none" >
258+ <maml : name >ReplaceVariablesInComments</maml : name >
259+ <maml : description >
260+ <maml : para >Perform SQLCMD variable replacement inside SQL comments.</maml : para >
261+ </maml : description >
262+ <command : parameterValue required =" false" >SwitchParameter</command : parameterValue >
263+ <dev : type >
264+ <maml : name >System.Management.Automation.SwitchParameter</maml : name >
265+ </dev : type >
266+ <dev : defaultValue >False</dev : defaultValue >
267+ </command : parameter >
268+
254269 </command : parameters >
255270
256271 <command : inputTypes >
You can’t perform that action at this time.
0 commit comments