Новый участник
Сообщения: 3
Благодарности: 0
|
Профиль
|
Отправить PM
| Цитировать
Кто я чтобы мешать чужому счастью )))
param(
$workPath = 'c:\tmp\root'
)
cls
$iteration = 0
function makeFolderTree {
If ($iteration -eq 0)
{
(1..10) | ForEach-Object{
New-Item -ItemType Directory -Path (Join-Path -Path $WorkPath -ChildPath $_) | Out-Null
}
}
foreach ($leaf in (Get-ChildItem -Directory -Recurse -Path $workPath | Where-Object {!(Get-ChildItem $_.FullName -Directory)}).FullName){
(1..10) | ForEach-Object{
New-Item -ItemType Directory -Path (Join-Path -Path $leaf -ChildPath $_) | Out-Null
}
}
$iteration++
If ($iteration -eq 10){
break
}
$iteration
makeFolderTree
}
makeFolderTree
|
Отправлено: 09:54, 15-01-2020
| #8
|