Add-WssBackupTarget
Add-WssBackupTarget
Adds a backup target to a scheduled backup.
Syntax
Parameter Set: Default
Add-WssBackupTarget [-BackupPolicy] <ScheduledBackupPolicy> [-BackupTarget] <BackupTarget> [-Force] [ <CommonParameters>]
Detailed Description
The Add-WssBackupTarget cmdlet adds a backup target to a scheduled backup policy. A scheduled backup policy is a backup file specification that has a backup schedule associated with it. When you add a backup target to the backup policy, the backup job adds the files in the backup policy that you specify to the new target location.
Parameters
-BackupPolicy<ScheduledBackupPolicy>
Specifies the scheduled backup policy to which to add the backup target.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-BackupTarget<BackupTarget>
Specifies the backup target to add.
Aliases |
none |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Force
Forces the command to run without asking for user confirmation.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1: Add a backup target to a scheduled backup policy
This example adds a backup target to a backup policy.
The first command gets the current backup policy for the computer and stores it in the variable named $ContosoBUPolicy213.
The second command creates a new backup target from the volume on drive F: and stores it in the variable named $ContosoBUTarget05.
The third command adds the backup target that is stored in $ContosoBUTarget05 to the backup policy that is stored in $ContosoBUPolicy213.
PS C:\> $ContosoBUPolicy213 = Get-WssBackupPolicy
PS C:\> $ContosoBUTarget05 = New-WBBackupTarget –VolumePath "F:\"
PS C:\> Add-WssBackupTarget -BackupPolicy $ContosoBUPolicy213 -BackupTarget $ContosoBUTarget05