Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Get-AzDataLakeGen2Item

Gets the details of a file or directory in a filesystem.

Syntax

Default (Default)

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

Description

The Get-AzDataLakeGen2Item cmdlet gets the details of a file or directory in a 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: Get a directory from a Filesystem, and show the details

$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

This command gets a directory from a Filesystem, and show the details.

Example 2: Get a file from a Filesystem

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

This command gets the details of a file from a Filesystem.

Parameters

-Context

Azure Storage Context Object

Parameter properties

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

Parameter sets

-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:AzureRmContext, AzureCredential

Parameter sets

-FileSystem

FileSystem name

Parameter properties

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

Parameter sets

-Path

The path in the specified Filesystem that should be retrieved. Can be a file or directory In the format 'directory/file.txt' or 'directory1/directory2/'. Not specify this parameter to get the root directory of the Filesystem.

Parameter properties

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

Parameter sets

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

IStorageContext

Outputs

AzureDataLakeGen2Item


Feedback

Was this page helpful?