Help Center
Choose product document...
Veeam Backup & Replication 9.5
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 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
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

Day

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

Specifies the days of week when the script will run.

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

Frequency

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

The number of job runs after which the script must run.

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 example shows how to configure scripts 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" -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 Backup Explorers User Guide

PowerShell Reference

RESTful API Reference

Veeam Backup FREE Edition User Guide

Veeam Backup for Microsoft Office 365

Veeam ONE Documentation

Veeam Endpoint Backup Documentation

Veeam Management Pack Documentation