Catatan
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba masuk atau mengubah direktori.
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba mengubah direktori.
Microsoft OneLake terintegrasi dengan modul Azure PowerShell untuk pembacaan, penulisan, dan manajemen data.
Menyambungkan ke OneLake dengan Azure PowerShell
Sambungkan ke OneLake dari PowerShell dengan mengikuti langkah-langkah berikut:
Instal modul Azure Storage PowerShell.
Install-Module Az.Storage -Repository PSGallery -ForceMasuk menggunakan akun Azure Anda.
Connect-AzAccountBuat konteks akun penyimpanan.
- Nama akun penyimpanan adalah onelake.
- Atur
-UseConnectedAccountagar kredensial Azure Anda mengalirkan langsung. - Atur
-endpointsebagaifabric.microsoft.com.
Jalankan perintah yang sama yang digunakan untuk Azure Data Lake Storage (ADLS) Gen2. Untuk informasi selengkapnya tentang ADLS Gen2 dan modul Azure Storage PowerShell, lihat Menggunakan PowerShell untuk mengelola ADLS Gen2.
Contoh: Dapatkan ukuran item atau direktori
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"