给定目录结构:
x\Code
x\Script\Backup.ps1
Backup.ps1 包含:
$BackupDirectoy = "..\Backup"
$CodeDirectory = "..\Code"
function BackupCurrentVersion()
{
New-Item $BackupDirectoy -type directory -force
Copy-Item $CodeDirectory -destination $BackupDirectory -recurse
}
BackupCurrentVersion
我做错了什么,因为代码被复制到 x\Script\Code 而不是 x\Backup\Code
问题是什么?