0
간단한 스크립트가 잘 적어도 나는 그것이해야한다고 생각하지만 최종 결과에 문제가 데 경우 : 문제는 결코 복사 파일입니다여기/else 문 및 복사 항목 문제
$a = Get-Content "content\file\location"
$destfile = "destination\of\file"
$source ="source\file\location"
$dest = "c$\destination"
$destfolder = "c:\folder\destination"
foreach ($a in $a) {
if (Test-Connection $a -Count 1 -Quiet) {
if (Test-Path "\\$a\$destfile") {
Write-Host $a "File exists" -ForegroundColor Green
} else {
Write-Host $a "File is missing and will now be copied to $a\$destfolder" -ForegroundColor Red |
Copy-Item $source -Destination "\\$a\$dest"
}
}
}
을, 나는 어디로 잘못 갔는가?
미리 도움을 주셔서 감사합니다.
은 완벽하게 작동했습니다. 고맙습니다. 언제나 그렇듯이이 커뮤니티는 초보자에게 올바른 패치를 알려줄 수 있습니다. 고마워. – NuckinFutz