你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Get-AzDataLakeGen2Item

获取文件系统中的文件或目录的详细信息。

语法

Default (默认值)

Get-AzDataLakeGen2Item
    [-FileSystem] <String>
    [-Path <String>]
    [-Context <IStorageContext>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

说明

Get-AzDataLakeGen2Item cmdlet 获取 Azure 存储帐户中文件系统中的文件或目录的详细信息。 仅当为存储帐户启用了分层命名空间时,此 cmdlet 才有效。 可以使用“-EnableHierarchicalNamespace $true”运行“New-AzStorageAccount”cmdlet 来创建此类帐户。

示例

示例 1:从文件系统获取目录,并显示详细信息

$dir1 = Get-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/"
$dir1

   FileSystem Name: filesystem1

Path                 IsDirectory  Length          LastModified         Permissions  Owner                Group
----                 -----------  ------          ------------         -----------  -----                -----
dir1                 True                         2020-03-23 09:15:56Z rwx---rwx    $superuser           $superuser

PS C:\WINDOWS\system32> $dir1.ACL

DefaultScope AccessControlType EntityId Permissions
------------ ----------------- -------- -----------
False        User                       rwx
False        Group                      ---
False        Other                      rwx

PS C:\WINDOWS\system32> $dir1.Permissions

Owner        : Execute, Write, Read
Group        : None
Other        : Execute, Write, Read
StickyBit    : False
ExtendedAcls : False

PS C:\WINDOWS\system32> $dir1.Properties.Metadata

Key          Value
---          -----
hdi_isfolder true
tag1         value1
tag2         value2

PS C:\WINDOWS\system32> $dir1.Properties

LastModified          : 3/23/2020 9:15:56 AM +00:00
CreatedOn             : 3/23/2020 9:15:56 AM +00:00
Metadata              : {[hdi_isfolder, true], [tag1, value1], [tag2, value2]}
CopyCompletedOn       : 1/1/0001 12:00:00 AM +00:00
CopyStatusDescription :
CopyId                :
CopyProgress          :
CopySource            :
CopyStatus            : Pending
IsIncrementalCopy     : False
LeaseDuration         : Infinite
LeaseState            : Available
LeaseStatus           : Unlocked
ContentLength         : 0
ContentType           : application/octet-stream
ETag                  : "0x8D7CF0ACBA35FA8"
ContentHash           :
ContentEncoding       : UDF12
ContentDisposition    :
ContentLanguage       :
CacheControl          : READ
AcceptRanges          : bytes
IsServerEncrypted     : True
EncryptionKeySha256   :
AccessTier            : Cool
ArchiveStatus         :
AccessTierChangedOn   : 1/1/0001 12:00:00 AM +00:00

此命令从文件系统获取目录,并显示详细信息。

示例 2:从文件系统获取文件

Get-AzDataLakeGen2Item -FileSystem "filesystem1" -Path "dir1/file1"
FileSystem Name: filesystem1

Path                 IsDirectory  Length          LastModified         Permissions  Owner                Group
----                 -----------  ------          ------------         -----------  -----                -----
dir1/file1           False        1024            2020-03-23 09:20:37Z rwx---rwx    $superuser           $superuser

此命令从文件系统获取文件的详细信息。

参数

-Context

Azure 存储上下文对象

参数属性

类型:IStorageContext
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅。

参数属性

类型:IAzureContextContainer
默认值:None
支持通配符:False
不显示:False
别名:AzureRmContext, AzureCredential

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-FileSystem

FileSystem 名称

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:0
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Path

应检索的指定文件系统中的路径。 可以是文件或目录,格式为“directory/file.txt”或“directory1/directory2/”。 不指定此参数以获取文件系统的根目录。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters

输入

String

IStorageContext

输出

AzureDataLakeGen2Item