Edit

Share via


New-AzNetAppFilesSnapshotPolicy

Creates a new Azure NetApp Files (ANF) snapshot policy for an ANF account.

Syntax

ByFieldsParameterSet (Default)

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

ByParentObjectParameterSet

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

Description

The New-AzNetAppFilesSnapshotPolicy cmdlet creates a new snapshot policy for an ANF account.

Examples

Example 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

This command creates the new ANF snapshot policy for ANF account named account "MyAccount".

Parameters

-AccountName

The name of the ANF account

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByFieldsParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AccountObject

The Account for the new Snapshot Policy object

Parameter properties

Type:PSNetAppFilesAccount
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByParentObjectParameterSet
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DailySchedule

A hashtable array which represents the daily Schedule

Parameter properties

Type:PSNetAppFilesDailySchedule
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Enabled

The property to decide policy is enabled or not

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-HourlySchedule

A hashtable array which represents the hourly Schedule

Parameter properties

Type:PSNetAppFilesHourlySchedule
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Location

The location of the resource

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByFieldsParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MonthlySchedule

A hashtable array which represents the monthly Schedule

Parameter properties

Type:PSNetAppFilesMonthlySchedule
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

The name of the ANF snapshot policy

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SnapshotPolicyName

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

The resource group of the ANF account

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByFieldsParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Tag

A hashtable array which represents resource tags

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Tags

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WeeklySchedule

A hashtable array which represents the monthly Schedule

Parameter properties

Type:PSNetAppFilesWeeklySchedule
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

PSNetAppFilesAccount

Outputs

PSNetAppFilesSnapshotPolicy