Created
January 26, 2014 15:24
-
-
Save bill-long/8634349 to your computer and use it in GitHub Desktop.
Powershell script to create a lot of public folders for testing.
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
# 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