Help Center
Choose product document...
Veeam Backup & Replication 9.5 Update 4
PowerShell Reference

New-VBRJobScriptOptions

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 the VBRJobScriptOptions object that contains pre-job and post-job script settings for backup jobs and for replication jobs. You can use this object later to apply these settings to a job.

Parameters

Parameter

Description

Required

Position

Accept
Pipeline
Input

Accept
Wildcard
Characters

PreScript
Enabled

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
Enabled

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: after a set number of job runs (Cycles) or on set days (Days).

Use the Day and the Frequency parameters to set the values.

False

Named

False

False

Day

Used to set value for the Periodicity parameter (the Days mode).

Specifies the days of week when the script will run.

Default: Saturday

False

Named

False

False

Frequency

Used to set value for the Periodicity parameter (the Cycles mode).

The number of job runs 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

VBRJobScriptOptions

Example

This command configures script settings with the following options:

  • A script runs before job and after job.
  • Scripts run on Mondays.

PS C:\PS> $scriptoptions = New-VBRJobScriptOptions -PreScriptEnabled -PreCommand "C:\scripts\pre-script.bat" -PostScriptEnabled -PostCommand "C:\scripts\pre-script.bat" -Periodicity Day -Day Monday

Veeam Large Logo

User Guide for VMware vSphere

User Guide for Microsoft Hyper-V

Enterprise Manager User Guide

Veeam Cloud Connect Guide

Veeam Agent Management Guide

Veeam Explorers User Guide

Backup and Restore of SQL Server Databases

Veeam Plug-ins for Enterprise Applications

PowerShell Reference

Veeam Explorers PowerShell Reference

RESTful API Reference

Required Permissions

Veeam Availability for Nutanix AHV

Veeam Backup for Microsoft Office 365 Documentation

Veeam ONE Documentation

Veeam Agent for Windows Documentation

Veeam Agent for Linux Documentation

Veeam Management Pack Documentation