New-VBRJobScriptOptions
Short Description
Creates new job script options.
Platform: VMware, Hyper-V
Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License
Syntax
|
New-VBRJobScriptOptions [-PreScriptEnabled] [-PreCommand <String>] [-PostScriptEnabled] [-PostCommand <String>] [-Day <DayOfWeek[]>] [-Periodicity <VBRPeriodicityType>] [-Frequency <UInt32>] [<CommonParameters>] |
Detailed Description
This cmdlet creates the VBRJobScriptOptions object. This object contains pre-job and post-job script settings for backup jobs and replication jobs. You can use this object later to apply these settings to a job.
Parameters
|
Parameter |
Description |
Type |
Required |
Position |
Accept Pipeline Input |
|---|---|---|---|---|---|
|
Day |
Specifies the value for the Specifies the days of week when the script will run.
Default: |
|
False |
Named |
False |
|
Frequency |
Specifies the value for the The number of job runs after which the script must run. Default: 1 backup session |
|
False |
Named |
False |
|
Periodicity |
Specifies the script run mode:
Use the |
|
False |
Named |
False |
|
PostCommand |
Specifies the path to the post-job script. |
|
False |
Named |
False |
|
PostScriptEnabled |
Defines that the cmdlet will run a script after the job.
Use the |
|
False |
Named |
False |
|
PreCommand |
Specifies the path to the pre-job script. |
|
False |
Named |
False |
|
PreScriptEnabled |
Defines that the cmdlet will run a script before the job.
Use the |
|
False |
Named |
False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see Microsoft Docs.
Output Object
Examples
Configuring Script Settings
This example shows how to configure script settings with the following options:
- A script runs before job and after job.
- Scripts run on Mondays.
|
$scriptoptions = New-VBRJobScriptOptions -PreScriptEnabled -PreCommand "C:\scripts\pre-script.bat" -PostScriptEnabled -PostCommand "C:\scripts\pre-script.bat" -Periodicity Days -Day Monday |
Perform the following steps:
- Run the
New-VBRJobScriptOptionscmdlet. Specify the following settings:- Provide the
PreScriptEnabledparameter. - Specify the
PreCommandparameter value. - Provide the
PostScriptEnabledparameter. - Specify the
PostCommandparameter value. - Set the
Daysoption for thePeriodicityparameter. - Specify the
Dayparameter value.
Save the result to the
$scriptoptionsvariable. - Provide the