Skip to content

Commit 8b327a0

Browse files
committed
More edits
1 parent fa6b580 commit 8b327a0

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

articles/storage/blobs/data-lake-storage-directory-file-acl-powershell.md

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,21 @@ This article shows you how to use PowerShell to create and manage directories, f
5454
5555
## Connect to the account
5656
57-
1. Open a Windows PowerShell command window.
57+
Open a Windows PowerShell command window, and then sign in to your Azure subscription with the `Connect-AzAccount` command and follow the on-screen directions.
5858
59-
2. Sign in to your Azure subscription with the `Connect-AzAccount` command and follow the on-screen directions.
60-
61-
```powershell
62-
Connect-AzAccount
63-
```
64-
65-
3. If your identity is associated with more than one subscription, then set your active subscription to subscription of the storage account that you want create and manage directories in.
66-
67-
```powershell
68-
Select-AzSubscription -SubscriptionId <subscription-id>
69-
```
59+
```powershell
60+
Connect-AzAccount
61+
```
7062

71-
Replace the `<subscription-id>` placeholder value with the ID of your subscription.
63+
If your identity is associated with more than one subscription, then set your active subscription to subscription of the storage account that you want create and manage directories in. In this example, replace the `<subscription-id>` placeholder value with the ID of your subscription.
7264

73-
### Get the storage context
65+
```powershell
66+
Select-AzSubscription -SubscriptionId <subscription-id>
67+
```
7468

75-
Choose how you want your commands obtain authorization to the storage account. Then, get the storage account context. Your commands can obtain authorization by using Azure Active Directory (AD), or by using the storage account key.
69+
Next, choose how you want your commands to obtain authorization to the storage account.
7670

77-
#### Obtain authorization by using Azure Active Directory (AD)
71+
### Option 1: Obtain authorization by using Azure Active Directory (AD)
7872

7973
With this approach, the system ensures that your user account has the appropriate role-based access control (RBAC) assignments and ACL permissions.
8074

@@ -83,7 +77,7 @@ $ctx = New-AzStorageContext -StorageAccountName '<storage-account-name>' -UseCon
8377
```
8478
Replace the `<storage-account-name>` placeholder value with the name of your storage account.
8579

86-
#### Obtain authorization by using the storage account key
80+
### Option 2: Obtain authorization by using the storage account key
8781

8882
With this approach, the system doesn't check the RBAC or ACL permissions of a resource.
8983

@@ -196,17 +190,15 @@ List the contents of a directory by using the `Get-AzDataLakeGen2ChildItem` cmdl
196190

197191
This example lists the contents of a directory named `my-directory`.
198192

199-
To list the contents of a file system, omit the `-Path` parameter from the command.
200-
201193
```powershell
202194
$filesystemName = "my-file-system"
203195
$dirname = "my-directory/"
204196
Get-AzDataLakeGen2ChildItem -Context $ctx -FileSystem $filesystemName -Path $dirname
205197
```
206198

207-
This example does not return values for the `ACL`, `Permissions`, `Group`, and `Owner` properties. To obtain those values, use the `-FetchPermission` parameter.
199+
This example doesn't return values for the `ACL`, `Permissions`, `Group`, and `Owner` properties. To obtain those values, use the `-FetchPermission` parameter.
208200

209-
The following example lists the contents of the file system and prints values for the `ACL`, `Permissions`, `Group`, and `Owner` properties to the console. The example also uses the `-Recurse` parameter to list the contents of all subdirectories.
201+
The following example lists the contents of the same directory, but it also uses the `-FetchPermission` parameter to return values for the `ACL`, `Permissions`, `Group`, and `Owner` properties.
210202

211203
```powershell
212204
$filesystemName = "my-file-system"
@@ -218,6 +210,8 @@ $properties.Group
218210
$properties.Owner
219211
```
220212

213+
To list the contents of a file system, omit the `-Path` parameter from the command.
214+
221215
## Upload a file to a directory
222216

223217
Upload a file to a directory by using the `New-AzDataLakeGen2Item` cmdlet.

0 commit comments

Comments
 (0)