Create a VHDX onto which to recover data
Mount the VHDX as a Drive Letter, e.g. R:
#Use Veeam Powershell Snapin
Add-PSSnapin VeeamPSSnapin
#Veeam Restore script
$result = Get-VBRBackup | where {$_.jobname -eq "<JOBNAME>"} | Get-VBRRestorePoint | where {$_.name -eq "<VMNAME>"} | Sort-Object creationtime -Descending | Select-Object -First 1 | Start-VBRWindowsFileRestore
If($result -eq $null)
{
Write-Output "Info: $(Get-Date) - No backup found for <VMNAME>"
exit
}
Add-PSSnapin VeeamPSSnapin
#Veeam Restore script
$result = Get-VBRBackup | where {$_.jobname -eq "<JOBNAME>"} | Get-VBRRestorePoint | where {$_.name -eq "<VMNAME>"} | Sort-Object creationtime -Descending | Select-Object -First 1 | Start-VBRWindowsFileRestore
If($result -eq $null)
{
Write-Output "Info: $(Get-Date) - No backup found for <VMNAME>"
exit
}
$Files1 = "<SOURCEPATH>"
$RestoreDestination1 = "R:\<DESTINATION>"
$File1 = $Result.Drives.Substring($Result.Drives.LastIndexOf(" ")).substring(1) + (split-path -NoQualifier "$Files1")
robocopy "$File1" "$RestoreDestination1" /MIR /R:0 /NFL /NDL
$RestoreDestination1 = "R:\<DESTINATION>"
$File1 = $Result.Drives.Substring($Result.Drives.LastIndexOf(" ")).substring(1) + (split-path -NoQualifier "$Files1")
robocopy "$File1" "$RestoreDestination1" /MIR /R:0 /NFL /NDL