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

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

Ветеран


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

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


Код: Выделить весь код
$sSourceFile = "\\Server\Share\SomeFile.iso"
$sDestPath   = "c:\Temp"

if(Test-Path -Path $sSourceFile -PathType Leaf) {
    if(Test-Path -Path $sDestPath -PathType Container) {
        $sStartTime = Get-Date
        Copy-Item -Path $sSourceFile -Destination $sDestPath -Force
        (New-TimeSpan -Start $sStartTime -End (Get-Date)).ToString()
    } else {
        Write-Host "Destination path [$sDestPath] not found." -ForegroundColor Red
    }
} else {
    Write-Host "Source file [$sSourceFile] not found." -ForegroundColor Red
}
Это сообщение посчитали полезным следующие участники:

Отправлено: 13:30, 25-07-2014 | #4