I haven't logged this with support as yet as I think it's going to be an easy one for those with a bit more powershell knowledge than myself
But I am currently in the process of creating a small script to allow users to remotely start a replica failover from a specific restore point.
I've got to the point in the script where I want to create a variable that contains the date/time of the restore point and select this for failover. This variable comes from a batch file which is read after Powershell is called.
Below is the code relating to this certain point in the script file.
Code: Select all
$point = Get-Content C:\Text.txt | Select -Last 1
$restore = Get-VBRReplica -Name DR | Get-VBRRestorePoint | Select CreationTime | where {$_.CreationTime -eq $point}
Start-VBRReplicaFailover -RestorePoint $restore -Reason "Test"
Just to confirm C:\Test.txt contains dates in the same format which is usually returned: 04/09/2012 11:11:11 for example.
Any ideas as to why this isn't working?
Thanks,
Wes