0
嗨不能弄清楚什麼錯了...我需要這個腳本來創建一個robocopy日誌文件夾,然後創建robocopy txt文件。工作正常,但它不會創建\ log文件夾...請幫助嗎?powershell文件夾創建和創建robocopy文件
$sourceFolder = "C:\x\y\z"
$destFolder = "C:\x\y\zz"
{
{
New-Item -ItemType Directory -Force -Path "$DestFolder\Log"
}
foreach ($folder in (Get-ChildItem -Directory $sourceFolder)) {
"robocopy `"$($sourceFolder)\$($folder)\zArchive\Data files to Nov 13`" `"$($destFolder)\$($folder)\folder`" /E /MOVE /DCOPY:T /log+:`"$DestFolder\Log\log.olog`"" | Out-File zArchiveMove.txt -Append
"robocopy `"$($sourceFolder)\$($folder)\Data files to Nov 13`" `"$($destFolder)\$($folder)\folder`" /E /MOVE /DCOPY:T /log+:`"$DestFolder\Log\log.olog`"" | Out-File zArchiveMove2.txt -Append
}
}