Skip to content

Instantly share code, notes, and snippets.

@dblock
Created April 1, 2013 12:55
Show Gist options
  • Save dblock/5284798 to your computer and use it in GitHub Desktop.
Save dblock/5284798 to your computer and use it in GitHub Desktop.
Get the list of snapshots using VMWareTasks.
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