我有一个非常简单的脚本,它在遵循psake约定(和示例)的任务构建部分中使用 Copy-Item 。现在,这就是它试图简化脚本以调试此问题所做的一切。
错误:
2011 年 7 月 18 日下午 5:40:57:发生错误:
Exec:执行命令时出错:Copy-Item "$src_dir..\somefolder*.dll" $bin_dir
我试过通过 Write-Host 输出文件路径,它们看起来很好。
我需要一些帮助,请调试这个,让脚本代码(Copy-Item)独立工作以psake不是目标。
剧本:
Properties {
$src_dir = Split-Path $psake.build_script_file
$bin_dir= "$build_dir\..\Binaries\"
}
include .\psake_ext.ps1
Task Build -Depends Clean, Init {
Write-Host "about to error here:"
Exec { Copy-Item "$src_dir\..\somefolder\*.dll" $bin_dir }
Write-Host "do NOT get this far"
#more similar Exec copy commands, that don't execute
}
Task Clean {
}
另请注意:
该脚本正在运行,并且只是在最近的过去间歇性地失败,但现在似乎更加一致地失败。
通过以下方式执行:
.\psake.ps1 "failing-copy-script.ps1" Build