Public/Get-FatDataLake.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
Function Get-FatDataLake {
    [cmdletbinding()]
    param(
        [parameter(Mandatory = $true)][string]$resourceGroupName,
        [parameter(Mandatory = $true)][string]$dataLakeName
    )
    Write-Verbose "Azure DataLake with the name $dataLakeName exists."
    $DataLakeStoreAccount = Get-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $dataLakeName -ErrorVariable nodatalake4u -ErrorAction Continue
    if ($nodatalake4u) {
        Write-Host "No Storage Account called $dataLakeName found in Resource Group $resourceGroupName"
    }
    return $DataLakeStoreAccount
}