Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Ветеран


Сообщения: 27449
Благодарности: 8087

Профиль | Отправить PM | Цитировать


Цитата 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
}
Это сообщение посчитали полезным следующие участники:

Отправлено: 21:25, 22-02-2014 | #14