Here is my code so far:
Code: Select all
$backup = Get-VBRBackup -Name $BackupJobName
$restorepoint = Get-VBRRestorePoint -Backup $backup | Where-Object {$_.VMName -eq $SpecificVM} | Sort-Object creationtime -Descending | Select-Object -First 1
$server = Get-VBRServer -Name $HelperHost
$session = Start-VBRLinuxFileRestore -RestorePoint $restorepoint -MountServer $server
$items = Get-VBRLinuxGuestItem -LinuxFlrObject $session -Path "/myDir/testFile"
$targetserver = Get-VBRServer -Name $TargetWindowsMachine #comes back empty
Copy-VBRLinuxGuestItem -Item $items -LinuxFlrObject $session -TargetFolder "D:\TestFolder\" -Server $targetserver
1) The Get-VBRServer command is not finding my $targetserver I want to copy to, even though I can find it going through a manual/GUI copy/restore.
2) If I point the $targetserver at a machine Get-VBRServer sees, I get as far as the copy piece but then get the error :Copy-VBRLinuxGuestItem : Cannot find mounted device for path: /myDir/testFile"
Does anyone have an example of or suggestions for what I am trying to accomplish? When I attempt this through the GUI I have no issues.