Share via


PowerShell ile OneLake'i yönetme

Microsoft Fabric OneLake, veri okuma, yazma ve yönetim için Azure PowerShell modülüyle tümleşir.

Azure PowerShell ile OneLake'e Bağlan

Aşağıdaki adımları izleyerek PowerShell'den OneLake'e Bağlan:

  1. Azure Depolama PowerShell modülünü yükleyin.

    Install-Module Az.Storage -Repository PSGallery -Force
    
  2. Azure hesabınızda oturum açın.

    Connect-AzAccount
    
  3. Depolama hesabı bağlamını oluşturun.

    • Depolama hesap adı onelake'dir.
    • Azure kimlik bilgilerinizi geçirmek için ayarlayın -UseConnectedAccount .
    • olarak fabric.microsoft.comayarlayın-endpoint.
  4. Azure Data Lake Depolama (ADLS) 2. Nesil için kullanılan komutları çalıştırın. ADLS 2. Nesil ve Azure Depolama PowerShell modülü hakkında daha fazla bilgi için bkz. ADLS 2. Nesil'i yönetmek için PowerShell kullanma.

Örnek: Bir öğenin veya dizinin boyutunu alma

Install-Module Az.Storage -Repository PSGallery -Force
Connect-AzAccount
$ctx = New-AzStorageContext -StorageAccountName 'onelake' -UseConnectedAccount -endpoint 'fabric.microsoft.com' 

# This example uses the workspace and item name. If the workspace name does not meet Azure Storage naming criteria (no special characters), you can use GUIDs instead.
$workspaceName = 'myworkspace'
$itemPath = 'mylakehouse.lakehouse/Files'

# Recursively get the length of all files within your lakehouse, sum, and convert to GB.
$colitems = Get-AzDataLakeGen2ChildItem -Context $ctx -FileSystem $workspaceName -Path $itemPath -Recurse -FetchProperty | Measure-Object -property Length -sum
"Total file size: " + ($colitems.sum / 1GB) + " GB"