In Part 1 of creating volumes from Protection Group (PGroup) sources I discussed how to get a specific snapshot to use for a disaster recovery (DR) restore. In the case of having a more automated DR workflow retrieving the latest snapshot from the PGroup is a key requirement.

The below PowerShell script example removes the manual task of picking a specific PGroup snapshot like in Part 1.

Note: You will notice that the Get-PfaAllVolumeSnapshots does not return a PSObject and the “created” field is returned as a string. Using [DateTime] I convert the string to a datetime and then compare that to get snapshots >8hrs.