Function Main
{
Create-MultipleFolders -Title "X" -Amount 999
}
Function Create-MultipleFolders
{
param (
[string]$Path = '',
[string]$Title = '',
[int]$Amount = 1)
if ($Path.Length -eq 0) {$Path = $pwd.path}
for ([int]$i = 1; $i -le $Amount; $i++)
{
[string]$TitleWithNumber = '{0}{1:d3}' -f $Title, $i
[string]$TargetFullName = $Path.Trim().Trim('\') + '\'
+ $TitleWithNumber
New-Item -Force -ItemType 'directory' -Path (
$TargetFullName -replace '([\`\[\]])', '`$1')
}
}
Main
https://i.imgur.com/BvkQu5Z.png