1
1
// Licensed to the .NET Foundation under one or more agreements.
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
- using System ;
5
- using System . Collections . Generic ;
6
- using System . Linq ;
7
- using System . Text ;
8
- using System . Threading . Tasks ;
9
4
using Microsoft . DotNet . Cli . Utils ;
10
5
using Microsoft . DotNet . Installer . Windows ;
11
6
using Microsoft . Management . Infrastructure ;
12
7
using Microsoft . Management . Infrastructure . Serialization ;
13
- using static Microsoft . ApplicationInsights . MetricDimensionNames . TelemetryContext ;
14
8
15
9
namespace Microsoft . DotNet . MsiInstallerTests
16
10
{
@@ -101,16 +95,6 @@ public CommandResult RunCommandOnVM(string[] args, string workingDirectory = nul
101
95
private IEnumerable < CimInstance > GetSnapshotInstances ( )
102
96
{
103
97
var snapshots = _session . QueryInstances ( virtNamespace , "WQL" , $ "SELECT * FROM Msvm_VirtualSystemSettingData WHERE VirtualSystemIdentifier='{ VMInstance . CimInstanceProperties [ "Name" ] . Value } ' And IsSaved='True'") . ToList ( ) ;
104
- //Log.WriteLine("Snapshot count: " + snapshots.Count);
105
- //foreach (var snapshot in snapshots)
106
- //{
107
- // Log.WriteLine(snapshot.CimInstanceProperties["ElementName"].Value.ToString());
108
- // //Log.WriteLine(snapshot.ToString());
109
- // //foreach (var prop in snapshot.CimInstanceProperties)
110
- // //{
111
- // // Log.WriteLine($"\t{prop.Name}: {prop.Value}");
112
- // //}
113
- //}
114
98
115
99
return snapshots ;
116
100
}
@@ -126,20 +110,12 @@ public async Task RenameSnapshotAsync(string snapshotId, string newName)
126
110
127
111
var managementService = _session . QueryInstances ( @"root\virtualization\v2" , "WQL" , "SELECT * FROM Msvm_VirtualSystemManagementService" ) . Single ( ) ;
128
112
var modifyVmMethod = managementService . CimClass . CimClassMethods . Single ( m => m . Name == "ModifySystemSettings" ) ;
129
- //foreach (var param in modifyVmMethod.Parameters)
130
- //{
131
- // Log.WriteLine($"{param.Name}: {param.CimType}");
132
- //}
133
113
134
114
var snapshot = snapshots . Single ( s => s . CimInstanceProperties [ "ConfigurationID" ] . Value . ToString ( ) == snapshotId ) ;
135
115
136
116
snapshot . CimInstanceProperties [ "ElementName" ] . Value = newName ;
137
117
138
118
Log . WriteLine ( "Renaming snapshot " + snapshotId + " to " + newName ) ;
139
- //foreach (var prop in snapshot.CimInstanceProperties)
140
- //{
141
- // Log.WriteLine($"\t{prop.Name}: {prop.Value}");
142
- //}
143
119
144
120
CimSerializer serializer = CimSerializer . Create ( ) ;
145
121
var snapshotString = Encoding . Unicode . GetString ( serializer . Serialize ( snapshot , InstanceSerializationOptions . None ) ) ;
@@ -279,10 +255,6 @@ private async Task WaitForJobSuccess(CimMethodResult result)
279
255
if ( jobState != JobState . Completed && jobState != JobState . CompletedWithWarnings )
280
256
{
281
257
Log . WriteLine ( "Job failed: " + jobState ) ;
282
- //foreach (var prop in job.CimInstanceProperties)
283
- //{
284
- // Log.WriteLine($"\t{prop.Name}: {prop.Value}");
285
- //}
286
258
287
259
string exceptionText = "Job failed: " + jobState ;
288
260
0 commit comments