Set-​Azure​Rm​Data​Lake​Store​Item​Expiry

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

Syntax

Set-AzureRmDataLakeStoreItemExpiry
   [-Account] <String>
   [-Path] <DataLakeStorePathInstance>
   [[-Expiration] <DateTimeOffset>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

Description

The Set-AzureRmDataLakeStoreItemExpiry 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

PS C:\> Set-AzureRmDataLakeStoreItemExpiry -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

PS C:\> Set-AzureRmDataLakeStoreItemExpiry -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.

Required Parameters

-Account

Specifies the Data Lake Store account name.

Type:String
Aliases:AccountName
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
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
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:False
Accept wildcard characters:False

Outputs

DataLakeStoreItem

The updated file with a new expiration time.

Notes

Alias: Set-AdlStoreItemExpiry