A sample (basic) PowerShell module that wraps the Azure Data Lake Store REST API.
Перейти к файлу
Alex Gonzalez b1216e4b3a
Update README.md
2019-11-12 15:00:01 +11:00
AzDls2 Sample code added and updated README. 2019-11-12 11:52:25 +11:00
.gitignore Initial commit 2019-11-11 23:31:50 +00:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2019-11-11 15:31:52 -08:00
LICENSE Initial LICENSE commit 2019-11-11 15:31:53 -08:00
README.md Update README.md 2019-11-12 15:00:01 +11:00
SECURITY.md Initial SECURITY.md commit 2019-11-11 15:31:55 -08:00

README.md

page_type languages products description urlFragment
sample
powershell
v5.1
PowerShell module to wrap the Azure Data Lake Store REST API.

Official Microsoft Sample

A sample (basic) PowerShell module that wraps the Azure Data Lake Store REST API.

Contents

File/folder Description
AzDls2 Sample AzDls2 PowerShell module.
.gitignore Define what to ignore at commit time.
CHANGELOG.md List of changes to the sample.
CONTRIBUTING.md Guidelines for contributing to the sample.
README.md This README file.
LICENSE The license for the sample.

Prerequisites

This module was written using PowerShell v5.1.

Setup

Install the module by copying the AzDls2 folder to one of the PowerShell module directories. These directories are saved in the environment variable %PSModulePath%. Default locations include:

  • C:\Program Files\WindowsPowerShell\Modules
  • C:\Windows\system32\WindowsPowerShell\v1.0\Modules

Runnning the sample

# Example: Show the current permissions
Get-AzDls2ChildItem -StorageAccountName 'azdls172' -FileSystemName 'container1' -AccessKey $key -Recurse | 
    ForEach-Object {
        $_ | Add-Member -Force -Type NoteProperty -Name AccessControl -Value ( Get-AzDls2ItemAccessControl -StorageAccountName 'azdls172' -FileSystemName 'container1' -AccessKey $key -Path $_.Name )
        $_
    } |
    Out-GridView

# Example: Take the ACL from each folder in the root of the file system and apply it to it's children
Get-AzDls2ChildItem -StorageAccountName 'azdls172' -FileSystemName 'container1' -AccessKey $key | 
    Where-Object {
        $_.isDirectory
    } |
    ForEach-Object {
        Push-AzDls2ItemAccessControl -StorageAccountName 'azdls172' -FileSystemName 'container1' -AccessKey $key -Directory $_.Name -Recurse
    }

Key concepts

The Azure Data Lake Store REST API provides an interface to administrate Azure Data Lake Storage Gen2. This sample PowerShell module demonstrates how the API can be used to recursively act on a file system instance.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.