你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

New-AzNetAppFilesSnapshotPolicy

为 ANF 帐户创建新的 Azure NetApp 文件 (ANF) 快照策略。

语法

New-AzNetAppFilesSnapshotPolicy
   -ResourceGroupName <String>
   -Location <String>
   -AccountName <String>
   -Name <String>
   [-Enabled]
   -HourlySchedule <PSNetAppFilesHourlySchedule>
   -DailySchedule <PSNetAppFilesDailySchedule>
   -WeeklySchedule <PSNetAppFilesWeeklySchedule>
   -MonthlySchedule <PSNetAppFilesMonthlySchedule>
   [-Tag <Hashtable>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzNetAppFilesSnapshotPolicy
   -Name <String>
   [-Enabled]
   -HourlySchedule <PSNetAppFilesHourlySchedule>
   -DailySchedule <PSNetAppFilesDailySchedule>
   -WeeklySchedule <PSNetAppFilesWeeklySchedule>
   -MonthlySchedule <PSNetAppFilesMonthlySchedule>
   [-Tag <Hashtable>]
   -AccountObject <PSNetAppFilesAccount>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

说明

New-AzNetAppFilesSnapshotPolicy cmdlet 为 ANF 帐户创建新的快照策略。

示例

示例 1

$hourlySchedule = @{
        Minute = 2
        SnapshotsToKeep = 6
    }
    $dailySchedule = @{
        Hour = 1
        Minute = 2
        SnapshotsToKeep = 6
    }
    $weeklySchedule = @{
        Minute = 2
        Hour = 1
        Day = "Sunday,Monday"
        SnapshotsToKeep = 6
    }
    $monthlySchedule = @{
        Minute = 2
        Hour = 1
        DaysOfMonth = "2,11,21"
        SnapshotsToKeep = 6
    }
New-AzNetAppFilesSnapshotPolicy -ResourceGroupName "MyRG" -Location "westus2" -AccountName "MyAccount" -Name "MySnapshotPolicy" -Enabled -HourlySchedule $hourlySchedule -DailySchedule $dailySchedule -WeeklySchedule $weeklySchedule -MonthlySchedule $monthlySchedule

此命令为名为帐户“MyAccount”的 ANF 帐户创建新的 ANF 快照策略。

参数

-AccountName

ANF 帐户的名称

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-AccountObject

新快照策略对象的帐户

Type:PSNetAppFilesAccount
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

提示你在运行 cmdlet 之前进行确认。

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-DailySchedule

表示每日计划的哈希表数组

Type:PSNetAppFilesDailySchedule
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅。

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Enabled

决定策略的属性已启用或不启用

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-HourlySchedule

表示每小时计划的哈希表数组

Type:PSNetAppFilesHourlySchedule
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Location

资源的位置

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-MonthlySchedule

表示 Montly Schedule 的哈希表数组

Type:PSNetAppFilesMonthlySchedule
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Name

ANF 快照策略的名称

Type:String
Aliases:SnapshotPolicyName
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

ANF 帐户的资源组

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Tag

表示资源标记的哈希表数组

Type:Hashtable
Aliases:Tags
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-WeeklySchedule

表示 Montly Schedule 的哈希表数组

Type:PSNetAppFilesWeeklySchedule
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

显示在此 cmdlet 运行的情况下将会发生什么。 此 cmdlet 未运行。

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

输入

PSNetAppFilesAccount

输出

PSNetAppFilesSnapshotPolicy