Skip to content

Instantly share code, notes, and snippets.

@bill-long
Created January 26, 2014 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bill-long/8634349 to your computer and use it in GitHub Desktop.
Save bill-long/8634349 to your computer and use it in GitHub Desktop.
Powershell script to create a lot of public folders for testing.
# Create-LotsOfPFs.ps1
#
# Creates 10,000 public folders
function CreateFoldersRecursive($parentFolder)
{
$currentDepth++
for ($x = 1; $x -le $foldersPerLevel; $x++)
{
$thisFolder = New-PublicFolder ("Folder " + $x.ToString()) -Path $parentFolder.Identity.ToString()
$thisFolder
if ($currentDepth -lt $desiredDepth)
{
CreateFoldersRecursive $thisFolder
}
}
}
$topFolder = New-PublicFolder "Lots Of Folders Here"
$desiredDepth = 4
$foldersPerLevel = 10
$currentDepth = 0
CreateFoldersRecursive $topFolder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment