Skip to content

Commit

Permalink
Create Create_One_Million_Files.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
Saveen Reddy authored Jan 10, 2017
1 parent b62975c commit e67ba53
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Samples/PowerShell/Create_One_Million_Files.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Set-StrictMode -Version 2
$ErrorActionPreference = "Stop"

# Login-AzureRmAccount -SubscriptionName <YOURSUBSCRIPTION>
$account = "YOURADLSACCOUNT"

# This script will create three levels of folders each hass a hundred subfolders
$level1 = 1..100
$level2 = 1..100
$level3 = 1..100

# Keep a count of the files
$count = 1

foreach ($a in $level1)
{
foreach ($b in $level2)
{
foreach ($c in $level3)
{
$remote_path = "/ManyFiles/" + $a + "/" + $b + "/" + $c + "/" + "data_" + $count + ".csv"

Write-Host $count, $remote_path

$value = $a.ToString() + "," + $b.ToString() + "," + $c.ToString() + "," + $count.ToString()
New-AdlStoreItem -Account $account -Path $remote_path -Force -Value $value

$count++
}
}
}

0 comments on commit e67ba53

Please sign in to comment.