To stress test a Storage Account in Azure, I want to create Millions of Dummy data. I use Powershell for that:
Create Random files
1..100000 | ForEach-Object -Parallel {
$file = New-Item -Path . -Name "file$_" -ItemType "file" -Value (New-Guid).Guid
azcopy copy $file.FullName $using:sasUrl | Out-Null
Remove-Item -Path $file.FullName -Force
} -ThrottleLimit 20
When I create 100000, the script works as designed. But when I add 1,000,000 - Powershell stops working after creating a couple of files. It just freeze. It doesn't throw any error.
Works: 1..100000 | ForEach-Object {}
Won't work: 1..1000000 | ForEach-Object {}
I am using Powershell 7.21 on Windows 10 (64 Bit)