I'm scripting the permanent failover and want to commit the most recent snapshot. The example I found in the helpcenter shows:
PS C:\PS> Get-VBRRestorePoint -Name "WebServer_replica" | Sort-Object $_.creationtime -Descending | Select -First 1 | Start-VBRViReplicaFailover -Reason "Configuration recovery" -RunAsync -Definite
If I run the Get-VBRRestorePoint command just to list the most recent replica with the "-First" switch, an older replica than if I use the "-Last" switch.
Which should give me the most recent replica?
thanks
PS C:\Users> Get-VBRRestorePoint -Name $VM | Sort-Object $_.creationtime -Descending | Select -First 1
VM Name Creation Time Type Failoved
------- ------------- ---- --------
VEEAMTEST01 4/26/2016 8:01:47 PM Snapshot
PS C:\Users> Get-VBRRestorePoint -Name $VM | Sort-Object $_.creationtime -Descending | Select -Last 1
VM Name Creation Time Type Failoved
------- ------------- ---- --------
VEEAMTEST01 4/26/2016 9:24:41 PM Snapshot
-
- Enthusiast
- Posts: 39
- Liked: 4 times
- Joined: Aug 20, 2014 1:00 pm
- Contact:
-
- Product Manager
- Posts: 20406
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Get-VBRRestorePoint - Most recent replica
Generally speaking, in the provided example the last restore point should be returned by combination of -descending and -first 1 parameters.
What happens if you change the syntax slightly:
Either this:
or this way:
Will the code still report an incorrect point?
Thanks.
What happens if you change the syntax slightly:
Either this:
Code: Select all
Get-VBRRestorePoint -Name $VM | Sort-Object {$_.creationtime} -Descending | Select -First 1
Code: Select all
Get-VBRRestorePoint -Name $VM | Sort-Object creationtime -Descending | Select -First 1
Thanks.
-
- Enthusiast
- Posts: 39
- Liked: 4 times
- Joined: Aug 20, 2014 1:00 pm
- Contact:
Re: Get-VBRRestorePoint - Most recent replica
Hi, both of your suggestions worked.. thank you very much!!
-
- Product Manager
- Posts: 20406
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Get-VBRRestorePoint - Most recent replica
You're welcome. Should other help be needed, don't hesitate to let us know. Thanks.
Who is online
Users browsing this forum: No registered users and 13 guests