@@ -78,36 +78,32 @@ public void ProgressUploadStatus(double precentComplete, double avgThroughputMbp
78
78
79
79
private void LogProgress ( int activityId , string activity , double precentComplete , TimeSpan remainingTime , double avgThroughputMbps )
80
80
{
81
- var message = String . Format ( Rsrc . PSSyncOutputEventsLogProgress ,
82
- precentComplete ,
83
- FormatDuration ( remainingTime ) ,
84
- avgThroughputMbps ) ;
85
- var progressCommand = String . Format ( @"Write-Progress -Id {0} -Activity '{1}' -Status '{2}' -SecondsRemaining {3} -PercentComplete {4}" , activityId , activity , message , ( int ) remainingTime . TotalSeconds , ( int ) precentComplete ) ;
86
- // TODO: CLU
87
- /*
88
81
using ( var ps = System . Management . Automation . PowerShell . Create ( ) )
89
82
{
90
83
ps . Runspace = runspace ;
84
+ var message = String . Format ( Rsrc . PSSyncOutputEventsLogProgress ,
85
+ precentComplete ,
86
+ FormatDuration ( remainingTime ) ,
87
+ avgThroughputMbps ) ;
88
+ var progressCommand = String . Format ( @"Write-Progress -Id {0} -Activity '{1}' -Status '{2}' -SecondsRemaining {3} -PercentComplete {4}" , activityId , activity , message , ( int ) remainingTime . TotalSeconds , ( int ) precentComplete ) ;
91
89
// TODO: CLU
90
+ Console . WriteLine ( progressCommand ) ;
92
91
//ps.AddScript(progressCommand);
93
92
//ps.Invoke();
94
93
}
95
- */
96
94
}
97
95
98
96
private void LogProgressComplete ( int activityId , string activity )
99
97
{
100
- var progressCommand = String . Format ( @"Write-Progress -Id {0} -Activity '{1}' -Status '{2}' -Completed" , activityId , activity , Rsrc . PSSyncOutputEventsLogProgressCompleteCompleted ) ;
101
- // TODO: CLU
102
- /*
103
98
using ( var ps = System . Management . Automation . PowerShell . Create ( ) )
104
99
{
105
- ps.Runspace = runspace ;
100
+ var progressCommand = String . Format ( @"Write-Progress -Id {0} -Activity '{1}' -Status '{2}' -Completed" , activityId , activity , Rsrc . PSSyncOutputEventsLogProgressCompleteCompleted ) ;
106
101
// TODO: CLU
102
+ Console . WriteLine ( progressCommand ) ;
103
+ ps . Runspace = runspace ;
107
104
//ps.AddScript(progressCommand);
108
105
//ps.Invoke();
109
106
}
110
- */
111
107
}
112
108
113
109
public void MessageCreatingNewPageBlob ( long pageBlobSize )
@@ -117,32 +113,29 @@ public void MessageCreatingNewPageBlob(long pageBlobSize)
117
113
118
114
private void LogMessage ( string format , params object [ ] parameters )
119
115
{
120
- var message = String . Format ( format , parameters ) ;
121
- var verboseMessage = String . Format ( "Write-Host '{0}'" , message ) ;
122
- // TODO: CLU
123
- /*
124
116
using ( var ps = System . Management . Automation . PowerShell . Create ( ) )
125
117
{
126
118
ps . Runspace = runspace ;
119
+ var message = String . Format ( format , parameters ) ;
120
+ var verboseMessage = String . Format ( "Write-Host '{0}'" , message ) ;
127
121
// TODO: CLU
122
+ Console . WriteLine ( verboseMessage ) ;
128
123
//ps.AddScript(verboseMessage);
129
124
//ps.Invoke();
130
125
}
131
- */
132
126
}
133
127
134
128
private void LogError ( Exception e )
135
129
{
136
- // TODO: CLU
137
- /*
138
130
using ( var ps = System . Management . Automation . PowerShell . Create ( ) )
139
131
{
140
132
ps . Runspace = runspace ;
141
- ps.AddCommand("Write-Error");
142
- ps.AddParameter("ErrorRecord", new ErrorRecord(e, String.Empty, ErrorCategory.NotSpecified, null));
133
+ // TODO: CLU
134
+ Console . Error . WriteLine ( new ErrorRecord ( e , String . Empty , ErrorCategory . NotSpecified , null ) ) ;
135
+ //ps.AddCommand("Write-Error");
136
+ //ps.AddParameter("ErrorRecord", new ErrorRecord(e, String.Empty, ErrorCategory.NotSpecified, null));
143
137
//ps.Invoke();
144
138
}
145
- */
146
139
}
147
140
148
141
public void MessageResumingUpload ( )
@@ -247,24 +240,20 @@ public void DebugEmptyBlockDetected(IndexRange range)
247
240
248
241
private void LogDebug ( string format , params object [ ] parameters )
249
242
{
250
- var message = String . Format ( format , parameters ) ;
251
- var debugMessage = String . Format ( "Write-Debug -Message '{0}'" , message ) ;
252
- // TODO: CLU
253
- /*
254
243
using ( var ps = System . Management . Automation . PowerShell . Create ( ) )
255
244
{
256
245
ps . Runspace = runspace ;
257
246
// TODO: CLU
247
+ var message = String . Format ( format , parameters ) ;
248
+ var debugMessage = String . Format ( "Write-Debug -Message '{0}'" , message ) ;
249
+ Console . WriteLine ( debugMessage ) ;
258
250
//ps.AddScript(debugMessage);
259
251
//ps.Invoke();
260
252
}
261
- */
262
253
}
263
254
264
255
public void ProgressEmptyBlockDetection ( int processedRangeCount , int totalRangeCount )
265
256
{
266
- // TODO: CLU
267
- /*
268
257
using ( var ps = System . Management . Automation . PowerShell . Create ( ) )
269
258
{
270
259
if ( processedRangeCount >= totalRangeCount )
@@ -273,6 +262,7 @@ public void ProgressEmptyBlockDetection(int processedRangeCount, int totalRangeC
273
262
var progressCommand1 = String . Format ( @"Write-Progress -Id {0} -Activity '{1}' -Status '{2}' -Completed" , 2 , Rsrc . PSSyncOutputEventsProgressEmptyBlockDetection , Rsrc . PSSyncOutputEventsEmptyBlockDetectionCompleted ) ;
274
263
ps . Runspace = runspace ;
275
264
// TODO: CLU
265
+ Console . WriteLine ( progressCommand1 ) ;
276
266
//ps.AddScript(progressCommand1);
277
267
//ps.Invoke();
278
268
return ;
@@ -281,18 +271,19 @@ public void ProgressEmptyBlockDetection(int processedRangeCount, int totalRangeC
281
271
var progressCommand = String . Format ( @"Write-Progress -Id {0} -Activity '{1}' -Status '{2}' -SecondsRemaining {3} -PercentComplete {4}" , 2 , Rsrc . PSSyncOutputEventsProgressEmptyBlockDetection , Rsrc . PSSyncOutputEventsEmptyBlockDetectionDetecting , - 1 , ( ( double ) processedRangeCount / totalRangeCount ) * 100 ) ;
282
272
ps . Runspace = runspace ;
283
273
// TODO: CLU
274
+ Console . WriteLine ( progressCommand ) ;
284
275
//ps.AddScript(progressCommand);
285
276
//ps.Invoke();
286
277
}
287
- */
288
278
}
289
279
290
280
public void WriteVerboseWithTimestamp ( string message , params object [ ] args )
291
281
{
292
282
// TODO: CLU
293
- /*
294
283
var messageWithTimeStamp = string . Format ( CultureInfo . CurrentCulture , "{0:T} - {1}" , DateTime . Now , string . Format ( message , args ) ) ;
295
284
var progressCommand = String . Format ( @"Write-Verbose -Message {0}" , messageWithTimeStamp ) ;
285
+ Console . WriteLine ( progressCommand ) ;
286
+ /*
296
287
using (var ps = System.Management.Automation.PowerShell.Create())
297
288
{
298
289
ps.Runspace = runspace;
0 commit comments