Set-VBRJobScriptOptions
Short Description
Modifies job script options.
Product Edition: Community, Standard, Enterprise, Enterprise Plus, Veeam Universal License
Syntax
|
Set-VBRJobScriptOptions -JobScriptOptions <VBRJobScriptOptions> [-PreScriptEnabled] [-PreCommand <String>] [-PostScriptEnabled] [-PostCommand <String>] [-Day <DayOfWeek[]>] [-Periodicity <VBRPeriodicityType>] [-Frequency <UInt32>] [<CommonParameters>] |
Detailed Description
This cmdlet modifies pre-job and post-job script settings for backup jobs and for replication jobs.
Note |
|
To modify settings, specify new values for the necessary parameters. The cmdlet will overwrite the previous parameters values with new values. The parameters that you omit will remain unchanged. |
Parameters
|
Parameter |
Description |
Type |
Required |
Position |
Accept Pipeline Input |
|---|---|---|---|---|---|
|
Day |
For the Specifies the days of the week when the script must run. |
|
False |
Named |
False |
|
Frequency |
For the Specifies the number of backup sessions after which the script must run. |
|
False |
Named |
False |
|
JobScriptOptions |
Specifies the script options that you want to modify.
Accepts the |
True |
Named |
False |
|
|
Periodicity |
Specifies the script run schedule:
Use the |
|
False |
Named |
False |
|
PostCommand |
For the Specifies the path to the post-job script. |
|
False |
Named |
False |
|
PostScriptEnabled |
Defines that you want to run a script after the job. |
|
False |
Named |
False |
|
PreCommand |
For the Specifies the path to the pre-job script. |
|
False |
Named |
False |
|
PreScriptEnabled |
Defines that you want to run a script before the job. |
|
False |
Named |
False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see Microsoft Docs.
Output Object
The cmdlet returns the VBRJobScriptOptions object that contains job script options.
Examples
Modifying Script Options [Using Variable]
This example shows how to get the script options for a computer backup job, save them to a variable, then modify the script options and re-save them to the variable.
|
$job = Get-VBRComputerBackupJob -Name "Backup Job" $scriptOptions = $job.ScriptOptions $newScriptOptions = Set-VBRJobScriptOptions -JobScriptOptions $scriptOptions -Periodicity Days -Day Thursday Set-VBRComputerBackupJob -Job $job -ScriptOptions $newScriptOptions |
Perform the following steps:
- Run the
Get-VBRComputerBackupJobReturns Veeam Agent backup jobs and Veeam Agent backup policies. cmdlet. Specify theNameparameter value. Save the result to the$jobvariable. - Save the
ScriptOptionsproperty of the$jobvariable to the$scriptOptionsvariable. - Run the
Set-VBRJobScriptOptionscmdlet. Specify the following settings:- Set the
$scriptOptionsvariable as theJobScriptOptionsparameter value. - Set the
Daysoption for thePeriodicityparameter. - Specify the
Dayparameter value.
Save the result to the
$newScriptOptionsvariable. - Set the
- Run the
Set-VBRComputerBackupJobModifies Veeam Agent backup jobs and Veeam Agent backup policies. cmdlet. Set the$jobvariable as theJobparameter value. Set the$newScriptOptionsvariable as theScriptOptionsparameter value.
Related Commands
Get-VBRComputerBackupJobReturns Veeam Agent backup jobs and Veeam Agent backup policies.Set-VBRComputerBackupJobModifies Veeam Agent backup jobs and Veeam Agent backup policies.