Created
April 1, 2013 12:55
-
-
Save dblock/5284798 to your computer and use it in GitHub Desktop.
Get the list of snapshots using VMWareTasks.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private List<string> GetSnapshotNames(IEnumerable<VMWareSnapshot> snapshots) | |
{ | |
List<string> result = new List<string>(); | |
foreach (VMWareSnapshot snapshot in snapshots) | |
{ | |
result.Add(snapshot.DisplayName); | |
result.AddRange(GetSnapshotNames(snapshot.ChildSnapshots)); | |
} | |
return result; | |
} | |
List<string> snapshotNames = GetSnapshotNames(virtualMachine.Snapshots); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment