“无法找到接受参数的位置参数”错误即将到来

时间:2018-03-18 12:00:33

标签: windows powershell

我一直在尝试让PowerShell使用CSV文件移动某些文件,以指示需要移动到的位置。

这是我的剧本:

import-csv sample1.csv  | foreach { copy-item $_.source\$_.file $_.destination\$_.file}

这是从中获取信息的csv。 image of the CSV of files i need to move.

如果有人可以提供帮助,那就太棒了。

1 个答案:

答案 0 :(得分:1)

什么是完整错误?假设它不喜欢你没有使用引号的事实:

Import-Csv sample1.csv  |
    ForEach-Object {
        Copy-Item -Path "$_.source\$_.file" -Destination "$_.destination\$_.file"
    }
相关问题