Short Description
Creates new job script options.
Applies to
Platform: VMware, Hyper-V
Product Edition: Standard, Enterprise, Enterprise Plus
Syntax
New-VBRJobScriptOptions [-PreScriptEnabled] [-PreCommand <string>] [-PostScriptEnabled] [-PostCommand <string>] [-Day <DayOfWeek[]> {Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday}] [-Periodicity <VBRPeriodicityType> {Cycles | Days}] [-Frequency <uint32>] [<CommonParameters>] |
Detailed Description
This cmdlet creates an object containing pre-job and post-job script settings for backup or replication jobs. You can use this object later to apply these settings to a job.
Parameters
Parameter | Description | Required | Position | Accept | Accept |
PreScript | Indicates that you want to run a script before the job. Use the PreCommand parameter to set the path to the script. | False | Named | False | False |
PreCommand | Specifies the path to the pre-job script. | False | Named | False | False |
PostScript | Indicates that you want to run a script after the job. Use the PostCommand parameter to set the path to the script. | False | Named | False | False |
PostCommand | Specifies the path to the post-job script. | False | Named | False | False |
Periodicity | Specifies the script run mode:
Use the Day and Frequency parameters to set the values. | False | Named | False | False |
Day | For the days mode. Specifies the days of week when the script will run. Default: Saturday. | False | Named | False | False |
Frequency | For the cycles mode. Specifies the number of backup sessions after which the script must run. Default:1 backup session. | False | Named | False | False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information about common parameters, see http://go.microsoft.com/fwlink/p/?LinkID=113216.
Return Type
Example
This example shows how to configure job script options. Veeam Backup & Replication will run the scripts on Mondays before and after the job.
PS C:\PS> $scriptoptions = New-VBRJobScriptOptions -PreScriptEnabled -PreCommand "C:\scripts\pre-script.bat" -PostScriptEnabled -PostCommand "C:\scripts\post-script.bat" -Periodicity Day -Day Monday |