Restore-AzDataLakeGen2DeletedItem
语法
ReceiveManual (默认值)
Restore-AzDataLakeGen2DeletedItem
[-FileSystem] <String>
[-Path] <String>
[-DeletionId] <String>
[-AsJob]
[-Context <IStorageContext>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ItemPipeline
Restore-AzDataLakeGen2DeletedItem
-InputObject <AzureDataLakeGen2DeletedItem>
[-AsJob]
[-Context <IStorageContext>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Restore-AzDataLakeGen2DeletedItem cmdlet 在 Azure 存储帐户的文件系统中还原已删除的文件或目录。
仅当为存储帐户启用了分层命名空间时,此 cmdlet 才有效。 可以使用“-EnableHierarchicalNamespace $true”运行“New-AzStorageAccount”cmdlet 来创建此类帐户。
示例
示例 1:列出文件系统中的所有已删除文件或目录,并按管道还原它们
$items = Get-AzDataLakeGen2DeletedItem -FileSystem "filesystem1"
$items
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
$items | Restore-AzDataLakeGen2DeletedItem
FileSystem Name: filesystem1
Path IsDirectory Length LastModified Permissions Owner Group
---- ----------- ------ ------------ ----------- ----- -----
dir0/dir1/file1 False 1024 2021-05-19 07:06:39Z rw-r----- $superuser $superuser
dir0/dir2 True 2021-05-19 07:06:37Z rwxr-x--- $superuser $superuser
dir0/dir2/file3 False 1024 2021-05-19 07:06:42Z rw-r----- $superuser $superuser
此命令列出文件系统中的所有已删除文件或目录,按管道还原所有这些文件。
示例 2:使用 path 和 DeletionId 还原单个文件
Restore-AzDataLakeGen2DeletedItem -FileSystem "filesystem1" -Path dir0/dir1/file1 -DeletionId 132658838415219780
FileSystem Name: filesystem1
Path IsDirectory Length LastModified Permissions Owner Group
---- ----------- ------ ------------ ----------- ----- -----
dir0/dir1/file1 False 1024 2021-05-19 07:06:39Z rw-r----- $superuser $superuser
此命令使用 path 和 DeletionId 还原单个文件。 可以使用“Get-AzDataLakeGen2DeletedItem”cmdlet 获取 DeleteId。
参数
-AsJob
在后台运行 cmdlet
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Context
Azure 存储上下文对象
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-DeletionId
与软删除路径关联的删除 ID。
可以使用 cmdlet“Get-AzDataLakeGen2DeletedItem”获取软删除路径及其关联的删除 ID。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
ReceiveManual
| Position: | 2 |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-FileSystem
FileSystem 名称
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
ReceiveManual
| Position: | 0 |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
要还原的 Azure Datalake Gen2 已删除项对象。
ItemPipeline
| Position: | Named |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Path
应还原的指定 FileSystem 中的已删除项路径。
格式为“directory/file.txt”或“directory1/directory2/”
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
ReceiveManual
| Position: | 1 |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。
命令脚本未运行。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。
输出