-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateStorageAcc.ps1
More file actions
32 lines (22 loc) · 860 Bytes
/
createStorageAcc.ps1
File metadata and controls
32 lines (22 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#Time when the script started
$starttime = [datetime]::UTCNow
#Location of the Resources
$locations = @("centralindia", "southindia", "westindia")
for($i=0; $i -lt 9; $i++) {
#Resource Group Name
$resourceGroup = "rg" + $i;
#Location
$location = $locations[$i%3];
#Storage Account Name
$storageName = "storage" + $(get-random);
#Creating Resource Group
New-AzResourceGroup -Name $resourceGroup -Location $location;
#Creating storage accounts
$job = New-AzStorageAccount -ResourceGroupName $resourceGroup -AccountName $storageName `
-Location $location -SkuName "Standard_LRS" -Kind StorageV2 -AsJob;
Start-Sleep 2;
}
wait-job $job
#Time when the script ended
$endtime = [datetime]::UTCNow
Write-output "Time taken to run the script $($($endtime - $starttime).TotalSeconds) Seconds"