Editar

Partilhar via


Get-AzDataLakeGen2DeletedItem

List all deleted files or directories from a directory or filesystem root.

Syntax

Get-AzDataLakeGen2DeletedItem
   [-FileSystem] <String>
   [[-Path] <String>]
   [-MaxCount <Int32>]
   [-ContinuationToken <String>]
   [-AsJob]
   [-Context <IStorageContext>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzDataLakeGen2DeletedItem cmdlet lists all deleted files or directories from a directory or filesystem in an Azure storage account. This cmdlet only works if Hierarchical Namespace is enabled for the Storage account. This kind of account can be created by run "New-AzStorageAccount" cmdlet with "-EnableHierarchicalNamespace $true".

Examples

Example 1: List all deleted files or directories from a Filesystem

Get-AzDataLakeGen2DeletedItem -FileSystem "filesystem1"

FileSystem Name: filesystem1

Path                 DeletionId           DeletedOn            RemainingRetentionDays
----                 ----------           ---------            ----------------------
dir0/dir1/file1      132658816156507617   2021-05-19 07:06:55Z 3                     
dir0/dir2            132658834541610122   2021-05-19 07:37:34Z 3                    
dir0/dir2/file3      132658834534174806   2021-05-19 07:37:33Z 3

This command lists all deleted files or directories from a Filesystem.

Example 2: List all deleted files or directories from a directory

Get-AzDataLakeGen2DeletedItem -FileSystem "filesystem1" -Path dir0/dir2

FileSystem Name: filesystem1

Path                 DeletionId           DeletedOn            RemainingRetentionDays
----                 ----------           ---------            ----------------------
dir0/dir2            132658834541610122   2021-05-19 07:37:34Z 3                     
dir0/dir2/file3      132658834534174806   2021-05-19 07:37:33Z 3

This command lists all deleted files or directories from a directory.

Parameters

-AsJob

Run cmdlet in the background

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

-Context

Azure Storage Context Object

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

-ContinuationToken

Continuation Token.

Type:String
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:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FileSystem

FileSystem name

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

-MaxCount

The max count of the blobs that can return.

Type:Nullable<T>[Int32]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Path

The path in the specified FileSystem that should be retrieved. Can be a directory In the format 'directory1/directory2/', Skip set this parameter to list items from root directory of the Filesystem.

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

Inputs

String

IStorageContext

Outputs

AzureDataLakeGen2DeletedItem