Skip to content

Instantly share code, notes, and snippets.

@grantpfeifer
Last active March 28, 2023 20:41
Show Gist options
  • Save grantpfeifer/5bedc0b8f2391416e917c41ca9055ba1 to your computer and use it in GitHub Desktop.
Save grantpfeifer/5bedc0b8f2391416e917c41ca9055ba1 to your computer and use it in GitHub Desktop.
Create SubFolders
$numOfFolers = 39
$suffix = "-DOC_NUMBER"
$contentsFolder = "C:\Users\grant.pfeifer\OneDrive - RoviSys-FeneTech\Desktop\test\40-DOC_NUMBER\*"
for ($i=1; $i -le $numOfFolers; $i++){
$filename = '{0:d2}' -f $i
$filename = $filename + $suffix
mkdir $filename
Copy-Item -Path $contentsFolder -Destination $filename -Recurse -PassThru
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment