File tree 1 file changed +15
-3
lines changed
test/PowerShellEditorServices.Test.E2E
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
- // Copyright (c) Microsoft Corporation.
1
+ // Copyright (c) Microsoft Corporation.
2
2
// Licensed under the MIT License.
3
3
4
4
using System ;
@@ -136,11 +136,23 @@ private string GenerateScriptFromLoggingStatements(params string[] logStatements
136
136
}
137
137
138
138
// Have script create file first with `>` (but don't rely on overwriting).
139
- StringBuilder builder = new StringBuilder ( ) . Append ( '\' ' ) . Append ( logStatements [ 0 ] ) . Append ( "' > '" ) . Append ( s_testOutputPath ) . AppendLine ( "'" ) ;
139
+ // NOTE: We uses double quotes so that we can use PowerShell variables.
140
+ StringBuilder builder = new StringBuilder ( )
141
+ . Append ( "Write-Output \" " )
142
+ . Append ( logStatements [ 0 ] )
143
+ . Append ( "\" > '" )
144
+ . Append ( s_testOutputPath )
145
+ . AppendLine ( "'" ) ;
146
+
140
147
for ( int i = 1 ; i < logStatements . Length ; i ++ )
141
148
{
142
149
// Then append to that script with `>>`.
143
- builder . Append ( '\' ' ) . Append ( logStatements [ i ] ) . Append ( "' >> '" ) . Append ( s_testOutputPath ) . AppendLine ( "'" ) ;
150
+ builder
151
+ . Append ( "Write-Output \" " )
152
+ . Append ( logStatements [ i ] )
153
+ . Append ( "\" >> '" )
154
+ . Append ( s_testOutputPath )
155
+ . AppendLine ( "'" ) ;
144
156
}
145
157
146
158
_output . WriteLine ( "Script is:" ) ;
You can’t perform that action at this time.
0 commit comments