Edit

Share via


Restore-AzDataLakeStoreDeletedItem

Restore a deleted file or folder in Azure Data Lake.

Syntax

Default (Default)

Restore-AzDataLakeStoreDeletedItem
    [-Account] <String>
    [-Path] <String>
    [-Destination] <String>
    [-Type] <String>
    [-RestoreAction <String>]
    [-PassThru]
    [-Force]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

InputObject

Restore-AzDataLakeStoreDeletedItem
    [-Account] <String>
    [-DeletedItem] <DataLakeStoreDeletedItem>
    [-RestoreAction <String>]
    [-PassThru]
    [-Force]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Restore-AzDataLakeStoreDeletedItem cmdlet restores a deleted file or folder in Data Lake Store. Requires the path of deleted item in trash returned by Get-AzDataLakeStoreDeletedItem. Caution: Undeleting files is a best effort operation. There are no guarantees that a file can be restored once it is deleted. The use of this API is enabled via allowlisting. If your ADL account is not allowlisted, then using this api will throw Not implemented exception. For further information and assistance please contact Microsoft support.

Examples

Example 1: Restore a file from the Data Lake Store using -force option

Restore-AzDataLakeStoreDeletedItem -Account ml1ptrashtest -Path 927e8fb1-a287-4353-b50e-3b4a39ae4088 -Destination adl://ml1ptrashtest.azuredatalake.com/test0/file_1230 -Type "file" -Force

This command restores a file from the Data Lake Store using -force option

Example 2: Restore a file from Data Lake Store using user confirmation

Restore-AzDataLakeStoreDeletedItem -Account ml1ptrashtest -Path 927e8fb1-a287-4353-b50e-3b4a39ae4088 -Destination adl://ml1ptrashtest.azuredatalake.com/test4/file_1115 -Type file
Restore user data ?
From - 927e8fb1-a287-4353-b50e-3b4a39ae4088
To   - adl://ml1ptrashtest.azuredatalake.com/test4/file_1115
Type - file
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): Y

This command restores a file from Data Lake Store using user confirmation

Parameters

-Account

Specifies the name of the Data Lake Store account.

Parameter properties

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

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
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

-DeletedItem

The deleted item object.

Parameter properties

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

Parameter sets

InputObject
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Destination

The destination path to where the deleted file or folder should be restored.

Parameter properties

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

Parameter sets

Default
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Force

Forces the command to run without asking for user confirmation.

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

-PassThru

Return boolean true on success.

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

-Path

The path of the deleted file or folder in trash.

Parameter properties

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

Parameter sets

Default
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-RestoreAction

Action to take on destination name conflicts - "copy" or "overwrite"

Parameter properties

Type:String
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:True
Value from remaining arguments:False

-Type

The type of entry being restored - "file" or "folder"

Parameter properties

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

Parameter sets

Default
Position:3
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
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

String

Outputs

None