When using a SQL Availability Group where one node has an active copy of the database at any given time and the other node does not have a readable copy of the database, what are some creative ways to use Powershell to determine which restorepoint actually contains the database for a restore for an automated restore script.
So you have $RestorepointNode1 and $RestorepointNode2 that each contain their respective latest restorepoint. I guess you could use a try/catch?
This actually does not work as I thought it might. It depends on the order of nodes in $Restorepoints. If I reverse the order of nodes it doesn't do what I wanted.