Set-AzDataLakeStoreItemExpiry

Sets or removes the expire time for a file in an Azure Data Lake Store account.

Syntax

Set-AzDataLakeStoreItemExpiry
   [-Account] <String>
   [-Path] <DataLakeStorePathInstance>
   [[-Expiration] <DateTimeOffset>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzDataLakeStoreItemExpiry
   [-Account] <String>
   [-Path] <DataLakeStorePathInstance>
   [-RelativeFileExpiryOption] <PathRelativeExpiryOptions>
   [[-RelativeTime] <Int64>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-AzDataLakeStoreItemExpiry cmdlet sets or removes the expire time for a file in an Azure Data Lake Store account.

Examples

Example 1: Set the expiration time for a file

Set-AzDataLakeStoreItemExpiry -AccountName "ContosoADL" -Path /myfile.txt -Expiration ([DateTimeOffset]::Now.AddHours(2))

Sets expiration on the file myfile.txt in account ContosoADL to be two hours from now. This will cause the file to expire (be marked for delete) in two hours.

Example 2: Remove the expiration on a file

Set-AzDataLakeStoreItemExpiry -AccountName "ContosoADL" -Path /myfile.txt

Removes any expiration that was previously set on file 'myfile.txt' in account 'ContosoADL'. This means the file will not automatically expire (be marked for delete) and will need to be manually deleted or set to expire again.

Example 3: Set expiration time for a file relative to now

Set-AzDataLakeStoreItemExpiry -Account "ContosoADL" -Path /myfile.txt -RelativeFileExpiryOption RelativeToNow -RelativeTime 240000
Set-AzDataLakeStoreItemExpiry -Account "ContosoADL" -Path /myfile.txt -RelativeFileExpiryOption RelativeToCreationDate -RelativeTime 240000

The first command sets the expiration time of the file /myfile.txt 240 seconds relative to current time at server. The second command sets the expiration time of the file /myfile.txt 240 seconds relative to creation time at server.

Parameters

-Account

Specifies the Data Lake Store account name.

Type:String
Aliases:AccountName
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-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

-Expiration

The absolute expiration time for the specified file. If no value or set to MaxValue, the file will never expire.

Type:DateTimeOffset
Position:2
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Path

Specifies the Data Lake Store path of the file item for which to set or remove expiry.

Type:DataLakeStorePathInstance
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-RelativeFileExpiryOption

Relative expiry options. RelativeToNow or RelativeToCreationDate are current options

Type:Microsoft.Azure.Commands.DataLakeStore.Models.DataLakeStoreEnums+PathRelativeExpiryOptions
Accepted values:RelativeToNow, RelativeToCreationDate
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-RelativeTime

The relative time in milliseconds with respect to now or creation time

Type:Int64
Position:3
Default value:None
Required:False
Accept pipeline input:True
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

String

DataLakeStorePathInstance

DateTimeOffset

Microsoft.Azure.Commands.DataLakeStore.Models.DataLakeStoreEnums+PathRelativeExpiryOptions

Int64

Outputs

DataLakeStoreItem

Notes

Alias: Set-AdlStoreItemExpiry