Start-WBBackup
Start-WBBackup
Starts a one-time backup operation.
Syntax
Start-WBBackup [-Policy] <WBPolicy> [-Async] [-Force] [<CommonParameters>]
Detailed Description
The Start-WBBackup cmdlet starts a one-time backup operation. You can use the settings for the scheduled backup defined in the backup policy (WBPolicy object). Or you can start a backup using new settings (refer to Notes).
Parameters
-Async <SwitchParameter>
Specifies for Windows PowerShell to return immediately after starting the backup. Do not output status to screen.
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
2 |
-Force <SwitchParameter>
Specifies to not prompt the user for confirmation.
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
3 |
-Policy <WBPolicy>
Specifies the backup policy (WBPolicy object) settings to use to create the backup.
Attributes
Name | Value |
---|---|
Required? |
true |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
true (ByValue) |
Position? |
1 |
-CommonParameter
This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, and OutVariable. For more information, see about_CommonParameters.
Input and Return Types
The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet emits.
Notes
If you use new settings to create a backup, specify values for the following:
Specify what items you want to include in the backup by using the following cmdlets: Add-WBVolumes, Add-WBFileSpecs, Add-WBSystemState, and Add-WBBareMetalRecovery.
Specify where the backup will be stored using the locations already defined in WBBackupTarget or update this object.
The WBPolicy object must be in edit mode. To put the WBPolicy object in edit mode for a policy that has been set as the scheduled backup policy, use the Get-WBPolicy cmdlet with the -Editable parameter. The New-WBPolicy cmdlet creates a new WBPolicy object already in edit mode.
To use Windows Server Backup cmdlets, you must be a member of the Administrators group or Backup Operators group.
Examples
EXAMPLE 1
C:\PS>$policy = New-WBPolicy
$fileSpec = New-WBFileSpec -FileSpec C:\15-12-08_1645.jpg
Add-WBFileSpec -Policy $policy -FileSpec $filespec
$volume = Get-WBVolume -VolumePath F:
Add-WBVolume -Policy $policy -Volume $volume
Add-WBSystemState $policy
Add-WBBareMetalRecovery $policy
$backupLocation = New-WBBackupTarget -VolumePath D:
Add-WBBackupTarget -Policy $policy -Target $backupLocation
Set-WBVssBackupOptions -Policy $policy -VssCopyBackup
Start-WBBackup -Policy $policy
The backup job status string objects.
Description
-----------
Starts a backup using new settings. In this example, the filespec C:\15-12-08_1645.jpg, volume F:, system state and ability for bare metal recovery are included as the backup source in the WBPolicy object $policy. Then, the location for backup, volume D: is added to the policy. The option to run the backup as a VSS Copy backup is then specified. A source for backup and the location to backup to are specified. Then the backup is started using the Start-WBBackup command.
EXAMPLE 2
C:\PS>$policy = Get-WBPolicy
Start-WBBackup -Policy $policy -Async
$backupJob = Get-WBJob
None
Description
-----------
Starts a backup using the settings for scheduled backups defined in the WBBackup object $policy. The backup is started using the Star-WBBackup cmdlet. Since the -Async flag is specified, the cmdlet returns immediately and the status of the backup can be viewed using the Get-WBJob command.