Redigera

Dela via


New-AzNetAppFilesExportPolicyObject

Creates export policy object.

Syntax

New-AzNetAppFilesExportPolicyObject
   -Rule <PSNetAppFilesExportPolicyRule[]>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

New-AzNetAppFilesExportPolicyObject is a helper cmdlet that creates an export policy object that can be used with New-AzNetAppFilesVolume. Each ExportPolicy object consists of a set of ExportPolicy rules that can be applied to an ANF volume.

Examples

Example 1

$exportPolicyRule = New-AzNetAppFilesExportPolicyRuleObject -RuleIndex 1 -AllowedClient '0.0.0.0/0' -UnixReadOnly -UnixReadWrite -Cifs -Nfsv3 
$exportPolicyRules = $($exportPolicyRule)
$newExportPolicy = New-AzNetAppFilesExportPolicyObject -Rule $exportPolicyRules
New-AzNetAppFilesVolume -ResourceGroupName "MyRG" -AccountName "MyAnfAccount" -PoolName "MyAnfPool" -Name "MyAnfVolume" -Location "westus2" -CreationToken "MyAnfVolume" -UsageThreshold 1099511627776 -ServiceLevel "Premium" -SubnetId "/subscriptions/subsId/resourceGroups/MyRG/providers/Microsoft.Network/virtualNetworks/MyVnetName/subnets/MySubNetName" -ExportPolicy $newExportPolicy

This example creates an ExportPolicyRule in variable $exportPolicyRule, sets it an export policy object $exportPolicyRules that is then used in the creation of an AFN volume "MyAnfVolume""

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-DefaultProfile

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

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

-Rule

List of items which need to be included into endpont scope.

Type:PSNetAppFilesExportPolicyRule[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

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

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

Inputs

None

Outputs

PSNetAppFilesVolumeExportPolicy