Set-OBPolicy
Set-OBPolicy
Sets the OBPolicy object as the backup policy that will be used for scheduled backups.
语法
Parameter Set: Default
Set-OBPolicy [-Policy] <CBPolicy> [-Confirm] [-WhatIf] [ <CommonParameters>]
详细说明
Sets the OBPolicy object as the backup policy that will be used for scheduled backups.
This cmdlet supports WhatIf and Confirm parameters with a high impact. The high impact signifies that the cmdlet will prompt the user for confirmation by default. The WhatIf parameter gives a verbose description of what the cmdlet does without performing any operation. The Confirm parameter specifies whether the cmdlet should prompt the user. Using –Confirm:$FALSE will override the prompt.
参数
-Policy<CBPolicy>
Specifies the current OBPolicy object be set as the active backup policy for the server.
别名 |
none |
是否必需? |
true |
在哪里? |
2 |
默认值 |
none |
是否接受管道输入? |
True (ByValue) |
是否接受通配符? |
false |
-Confirm
在运行 cmdlet 前提示你进行确认。
是否必需? |
false |
在哪里? |
named |
默认值 |
false |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-WhatIf
显示在 cmdlet 运行时将发生的情况。该 cmdlet 不运行。
是否必需? |
false |
在哪里? |
named |
默认值 |
false |
是否接受管道输入? |
false |
是否接受通配符? |
false |
<CommonParameters>
此 cmdlet 支持常见的参数:-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer 和 -OutVariable。有关详细信息,请参阅 TechNet 上的 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
输入
输入类型是可以传送到 cmdlet 的对象的类型。
- Microsoft.Internal.CloudBackup.Commands.OBPolicy
输出
输出类型是 cmdlet 发出的对象的类型。
Microsoft.Internal.CloudBackup.Commands.OBPolicy
This cmdlet sets the OBPolicy object as the backup policy to use for scheduled backups.
示例
EXAMPLE 1
This example sets a new online backup policy for a server.
PS C:\> $fspec = New-OBFileSpec –FileSpec C:\test\texttext1.txt
PS C:\> $rpolicy = New-OBRetentionPolicy
PS C:\> $sch = New-OBSchedule
PS C:\> New-OBPolicy | Add-OBFileSpec -FileSPec $fspec | Set-OBRetentionPolicy -RetentionPolicy $rpolicy | Set-OBSchedule -Schedule $sch | Set-OBPolicy