Created
December 13, 2017 10:26
-
-
Save RichieBzzzt/f1af624ccbf97f2802983506abb3d84a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Login-AzureRmAccount | |
$subscriptionName = "" | |
$ResourceGroupName = "" | |
$location = "" | |
$dataLakeStoreName = "" | |
Select-AzureRmSubscription -SubscriptionName $subscriptionName | |
Write-Host "Step 2 - Configure Resource Group" -ForegroundColor White -BackgroundColor DarkGreen | |
try { | |
$CheckResourceGroupExists = Get-AzureRmResourceGroup -Name $ResourceGroupName | |
} | |
catch { | |
Write-Host "oh dear" -ForegroundColor Black -BackgroundColor DarkRed | |
throw | |
} | |
if ($CheckResourceGroupExists -eq $false) { | |
"Resource Group doesn't exist. Creating..." | |
New-AzureRmResourceGroup -Name $ResourceGroupName -Location $location | |
} | |
elseif ($CheckResourceGroupExists -eq $true) { | |
"Resource Group exists." | |
} | |
Write-Host "Step 3 - Configure Data Lake Store Account" -ForegroundColor White -BackgroundColor DarkGreen | |
try { | |
$CheckDataLakStoreAccountExists = Test-AzureRmDataLakeStoreAccount -Name $dataLakeStoreName | |
} | |
catch { | |
Write-Host "oh dear" -ForegroundColor Black -BackgroundColor DarkRed | |
throw | |
} | |
if ($CheckDataLakStoreAccountExists -eq $false) { | |
"Data Lake Storage Account doesn't exist. Creating..." | |
New-AzureRmDataLakeStoreAccount -Name $dataLakeStoreName -ResourceGroupName $ResourceGroupName -Location $location | |
} | |
elseif ($CheckDataLakStoreAccountExists -eq $true) { | |
"Data Lake Storage Account exists." | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment