I am trying to set up a script to restore a file but its failing due to the session not being correct for some reason.
my script is:
Code: Select all
$restore_point = Get-VBRBackup -Name "Backup Job 1E" | Get-VBRRestorePoint -Name ServerX | Sort-Object –Property CreationTime –Descending | Select-Object -First 1
$restore_start = Start-VBRWindowsFileRestore -RestorePoint $restore_point -Reason "Backup Integrity Check"
$session = Get-VBRRestoreSession
$items = Get-VBRWindowsGuestItem -Session $session -Path "C:\VeeamRestoreTest\ServerXDrive.txt"
Copy-VBRWindowsGuestItem -Item $items -TargetFolder "C:\VeeamRestoreCheck\ServerX" -Session $session -KeepPermissionsAndOwnership -RunAsync
Stop-VBRWindowsFileRestore $restore_start
Code: Select all
$items = Get-VBRWindowsGuestItem -Session $session -Path "C:\VeeamRestoreTest\ServerXDrive.txt"
Get-VBRWindowsGuestItem : Cannot convert 'System.Object[]' to the type 'Veeam.Backup.Core.CRestoreSession' required by
parameter 'Session'. Specified method is not supported.
At line:1 char:43
+ $items = Get-VBRWindowsGuestItem -Session $session -Path "C:\VeeamRes ...
+ ~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-VBRWindowsGuestItem], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Veeam.Backup.PowerShell.Cmdlets.GetVBRWindowsGuestItem
thanks
Paul