Anyway, part of the script
Code: Select all
New-VBRDailyOptions -Type SelectedDays -DayOfWeek 'Sunday' -Period 01:00 -AlwaysCopyFromLatestFull
Recently we had an issue with SOBR tiering and upgraded to Version 11 to correct the fault.
Now when the powershell script runs, the script section returns an error.
Code: Select all
New-VBRDailyOptions : A parameter cannot be found that matches parameter name 'AlwaysCopyFromLatestFull'
Full Script is below to give full context.
Code: Select all
Add-PSSnapin VeeamPSSnapin
$DateTime = ([DateTime]::Today).AddDays(0)
$Weekends = @("Saturday", "Sunday")
$BH = @( $Hols = (Invoke-RestMethod -Uri https://www.gov.uk/bank-holidays.json -Method GET).'england-and-wales'.events.date
Foreach ($Das in $hols){
Get-Date -Date $Das
}
)
$LastDay = (0..31 | ForEach-Object { (Get-Date "$($DateTime.Year)-$($DateTime.Month)-01").AddDays($_) } | Where-Object { $_.Month -eq $($DateTime.Month) } | Where-Object { $_.dayofweek -notin $Weekends } | Where-Object { $_ -notIn $BH })[-1]
$DateTimePlus = ($DateTime).AddDays(1)
$DateTimeSun = ($DateTime).AddDays(2)
$MonthlyJob = ($DateTimePlus.DayOfWeek).ToString()
$MonthlySun = ($DateTimeSun.DayOfWeek).ToString()
$FridayJob = $LastDay.DayOfWeek
If($LastDay -eq $DateTime)
{
IF ($FridayJob -eq 'Friday')
{
#Write-Host Friday so run on $MonthlySun
Disable-VBRJob -Job "Daily Tape Job LTO6"
Disable-VBRJob -Job "Daily Tape Job LTO7"
Enable-VBRJob -Job "Monthly Tape Job LTO6"
Enable-VBRJob -Job "Monthly Tape Job LTO7"
Set-VBRBackupToTapeJob -Job "Monthly Tape Job LTO6" -ScheduleOptions (New-VBRBackupToTapeScheduleOptions -Enabled -DailyOptions (New-VBRDailyOptions -Type SelectedDays -DayOfWeek $MonthlySun -Period 01:00 -AlwaysCopyFromLatestFull))
Set-VBRBackupToTapeJob -Job "Monthly Tape Job LTO7" -ScheduleOptions (New-VBRBackupToTapeScheduleOptions -Enabled -DailyOptions (New-VBRDailyOptions -Type SelectedDays -DayOfWeek $MonthlySun -Period 01:00 -AlwaysCopyFromLatestFull))
}
Else
{
#Write-Host Monhly Job run on $MonthlyJob
Disable-VBRJob -Job "Daily Tape Job LTO6"
Disable-VBRJob -Job "Daily Tape Job LTO7"
Enable-VBRJob -Job "Monthly Tape Job LTO6"
Enable-VBRJob -Job "Monthly Tape Job LTO7"
Set-VBRBackupToTapeJob -Job "Monthly Tape Job LTO6" -ScheduleOptions (New-VBRBackupToTapeScheduleOptions -Enabled -DailyOptions (New-VBRDailyOptions -Type SelectedDays -DayOfWeek $MonthlyJob -Period 01:00 -AlwaysCopyFromLatestFull))
Set-VBRBackupToTapeJob -Job "Monthly Tape Job LTO7" -ScheduleOptions (New-VBRBackupToTapeScheduleOptions -Enabled -DailyOptions (New-VBRDailyOptions -Type SelectedDays -DayOfWeek $MonthlyJob -Period 01:00 -AlwaysCopyFromLatestFull))
}
}
Else
{
If($DateTime -in $BH){
#Write-Host Bank Holiday
Disable-VBRJob -Job "Daily Tape Job LTO6"
Disable-VBRJob -Job "Daily Tape Job LTO7"
Disable-VBRJob -Job "Monthly Tape Job LTO6"
Disable-VBRJob -Job "Monthly Tape Job LTO7"
}
Else
{
#Write-Host Normal Day
Enable-VBRJob -Job "Daily Tape Job LTO6"
Enable-VBRJob -Job "Daily Tape Job LTO7"
Disable-VBRJob -Job "Monthly Tape Job LTO6"
Disable-VBRJob -Job "Monthly Tape Job LTO7"
}
}