$job = Get-VBRJob -Name Test
$option = $job.GetOptions()
$option.GenerationPolicy.EnableCompactFull = $True
$option.GenerationPolicy.CompactFullBackupDays = "Saturday" (This option is not working, the option stay at the Monthly First Monday)
$job.SetOptions($job.Options)
Property 'DayOfWeek' cannot be found on this object; make sure it exists and is
settable.
At C:\Veeam-Scripts\Extra-Scripts\veeam\backupcopyjob-compactbackup.ps1:4 char:
67
+ $Options.GenerationPolicy.CompactFullBackupMonthlyScheduleOptions. <<<< DayOf
Week = "1"
+ CategoryInfo : InvalidOperation: (DayOfWeek:String) [], Runtime
Exception
+ FullyQualifiedErrorId : PropertyNotFound
asnp VeeamPSSnapin
$Job = Get-VBRJob -name "name of backup copy job" # specify a name of your backup job here
$Options = $Job.GetOptions()
$Options.GenerationPolicy.EnableCompactFull = $True
$Options.GenerationPolicy.CompactFullBackupMonthlyScheduleOptions.DayOfWeek = "6"
$Job.SetOptions($Options)
Yes this works but maybe I do not explain correctly, I do not want the Monthly option I want that my backup copy job is compact every week. (The option under the monthly one).
Thanks