New-VBRJobOptions
Short Description
Creates new job options.
Applies to
Platform: VMware, Hyper-V
Product Edition: Standard, Enterprise, Enterprise Plus
Syntax
This cmdlet provides 3 parameter sets.
- For editing all job options:
- For editing backup jobs options:
- For editing replication jobs options:
Detailed Description
This cmdlet returns default job settings. You can edit any setting that you want to apply to a job.
Run Set-VBRJobOptions to apply the modified options to a job.
Parameters
Parameter | Description | Required | Position | Accept | Accept |
ForBackupJob | Indicates that the cmdlet will return default settings for backup job. | False | Named | False | False |
ForReplicaJob | Indicates that the cmdlet will return default settings for replication job. | False | Named | False | False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About CommonParameters section of Microsoft Docs.
This example shows how to define the retention policy for a backup job.
You will need to perform the following steps:
- Run New-VBRJobOptions to get the object with the default backup job settings. Save the result to the $retention variable.
- Edit the backup storage settings. Use the RetainCycles parameter of the BackupStorageOptions object to specify the number of restore points.
- Run Get-VBRJob to get the job to which you want to apply the retention policy. Save the result to the $job variable.
- Run Set-VBRJobOptions with the $job and $retention variables to apply the retention policy.
$retention = New-VBRJobOptions -ForBackupJob $retention.BackupStorageOptions.RetainCycles = 7 $job = Get-VBRJob -Name "ABC Backup" Set-VBRJobOptions -Job $job -Options $retention |
Related commands