Цитата timbird:
Iska, поделитесь кодом? »
|
Примерно так:
Код:

$sSourceFolder = "E:\Песочница\0364\Source"
$sDestFolder = "E:\Песочница\0364\Destination"
if(Test-Path -Path $sSourceFolder -PathType Container) {
if(Test-Path -Path $sDestFolder -PathType Container) {
Get-ChildItem -Path $sSourceFolder -Include "*QQQ*.xsl", "*WWW*.xsl" -Recurse |`
Where-Object -FilterScript { $_.DirectoryName -like "*01-NAME-iqwuey*" } |`
ForEach-Object -Process {
$DestPath = $sDestFolder + ($_.DirectoryName).Substring($sSourceFolder.Length)
if(-not (Test-Path -Path $DestPath -PathType Container)) {
New-Item -Path $sDestFolder -Name ($_.DirectoryName).Substring($sSourceFolder.Length + 1) -ItemType Container | Out-Null
}
Write-Host $_.FullName
Copy-Item -Path $_.FullName -Destination $DestPath -Force
}
} else {
Write-Host "Destination folder [$sDestFolder] not found." -ForegroundColor Red
}
} else {
Write-Host "Source folder [$sSourceFolder] not found." -ForegroundColor Red
}