New-OBRetentionPolicy

New-OBRetentionPolicy

Creates a new OBRetentionPolicy specifying the number of days that the backup needs to be retained.

语法

Parameter Set: Default
New-OBRetentionPolicy [[-RetentionDays] <Int64> ] [[-RetentionWeeklyPolicy]] [[-WeekDaysOfWeek] <System.Collections.Generic.List`1[[System.DayOfWeek, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]> ] [[-WeekTimesOfDay] <System.Collections.Generic.List`1[[System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]> ] [[-RetentionWeeks] <System.Int64> ] [[-RetentionMonthlyPolicy]] [-MonthDaysOfMonth <System.Collections.Generic.List`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]> ] [-MonthDaysOfWeek <System.Collections.Generic.List`1[[System.DayOfWeek, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]> ] [-MonthTimesOfDay <System.Collections.Generic.List`1[[System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]> ] [-MonthWeeksOfMonth <System.Collections.Generic.List`1[[Microsoft.Internal.CloudBackup.ObjectModel.OMCommon.CBNthWeek, CBEngineServiceProxy, Version=1.0.523.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]> ] [-RetentionMonths <System.Int64> ] [-RetentionYearlyPolicy] [-RetentionYears <System.Int64> ] [-YearDaysOfMonth <System.Collections.Generic.List`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]> ] [-YearDaysOfWeek <System.Collections.Generic.List`1[[System.DayOfWeek, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]> ] [-YearMonthsOfYear <System.Collections.Generic.List`1[[Microsoft.Internal.CloudBackup.ObjectModel.OMCommon.CBMonth, CBEngineServiceProxy, Version=1.0.523.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]> ] [-YearTimesOfDay <System.Collections.Generic.List`1[[System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]> ] [-YearWeeksOfMonth <System.Collections.Generic.List`1[[Microsoft.Internal.CloudBackup.ObjectModel.OMCommon.CBNthWeek, CBEngineServiceProxy, Version=1.0.523.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]> ] [ <CommonParameters>]

详细说明

The New-OBRetentionPolicy creates a new OBRetentionPolicy object specifying the number of days to retain the backed up items.

参数

-MonthDaysOfMonth<System.Collections.Generic.List`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]>

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-MonthDaysOfWeek<System.Collections.Generic.List`1[[System.DayOfWeek, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]>

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-MonthTimesOfDay<System.Collections.Generic.List`1[[System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]>

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-MonthWeeksOfMonth<System.Collections.Generic.List`1[[Microsoft.Internal.CloudBackup.ObjectModel.OMCommon.CBNthWeek, CBEngineServiceProxy, Version=1.0.523.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]>

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-RetentionDays<Int64>

Specifies the number of days to retain the backup data. Retention days must be specified as either 7, 15, or 30. Other integers are not supported.

别名

none

是否必需?

false

在哪里?

2

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-RetentionMonthlyPolicy

别名

none

是否必需?

false

在哪里?

7

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-RetentionMonths<System.Int64>

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-RetentionWeeklyPolicy

别名

none

是否必需?

false

在哪里?

3

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-RetentionWeeks<System.Int64>

别名

none

是否必需?

false

在哪里?

6

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-RetentionYearlyPolicy

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-RetentionYears<System.Int64>

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-WeekDaysOfWeek<System.Collections.Generic.List`1[[System.DayOfWeek, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]>

别名

none

是否必需?

false

在哪里?

4

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-WeekTimesOfDay<System.Collections.Generic.List`1[[System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]>

别名

none

是否必需?

false

在哪里?

5

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-YearDaysOfMonth<System.Collections.Generic.List`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]>

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-YearDaysOfWeek<System.Collections.Generic.List`1[[System.DayOfWeek, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]>

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-YearMonthsOfYear<System.Collections.Generic.List`1[[Microsoft.Internal.CloudBackup.ObjectModel.OMCommon.CBMonth, CBEngineServiceProxy, Version=1.0.523.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]>

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-YearTimesOfDay<System.Collections.Generic.List`1[[System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]>

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-YearWeeksOfMonth<System.Collections.Generic.List`1[[Microsoft.Internal.CloudBackup.ObjectModel.OMCommon.CBNthWeek, CBEngineServiceProxy, Version=1.0.523.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]>

别名

none

是否必需?

false

在哪里?

named

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

<CommonParameters>

此 cmdlet 支持常见的参数:-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer 和 -OutVariable。有关详细信息,请参阅 TechNet 上的 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

输入

输入类型是可以传送到 cmdlet 的对象的类型。

  • None

输出

输出类型是 cmdlet 发出的对象的类型。

  • Microsoft.Internal.CloudBackup.Commands.OBRetentionPolicy

    Specifies the number of days that the backup needs to be retained.

示例

EXAMPLE 1

This example creates a new retention policy.

PS C:\> New-OBRetentionPolicy -RetentionDays 30

相关主题

Get-OBRetentionPolicy

Set-OBRetentionPolicy

New-OBPolicy