Scoping and filtering a list of snapshots

As with other cmdlets, there are several ways to approach scoping and filtering a list of snapshots in PowerCLI. There are several methods and some will have benefits in one situation over another. In this recipe, you will look at a couple of different ways to scope a list of snapshots.

Getting Started

To begin this recipe, you will need a PowerCLI window and an active connection to vCenter. You should also have completed the previous recipe.

In this recipe, you will write PowerCLI that will scope down the list of snapshots returned in the output object to only include snapshots that were created more than 30 days ago. However, since your environment might not have snapshots more than 30 days old, you can ...

Get PowerCLI Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.