powershell - 目的地的复制项目问题

标签 powershell command

我有两个Copy-Item命令

  • Copy-Item "C:\Test\folder1" "\\remote_machine\destination" -Recurse
  • Copy-Item "C:\Test\folder2" "\\remote_machine\destination" -Recurse

  • folder1和folder2包含文件夹和文件

    这两个命令都相似,但结果却不同
  • 将folder1的内容复制到目标位置-好的
  • 将所有内容的folder2复制到目标-\ remote_machine \ destination \ folder2-失败

  • 更新:我没有任何错误。问题是有关第二个文件夹的路径。我要将两个文件夹的内容都放在一个目标文件夹中。

    最佳答案

    PowerShell出现问题-http://groups.google.com/group/microsoft.public.windows.powershell/browse_frm/thread/ae9b8b4424c2af22

    我的示例的解决方案是

  • Copy-Item "C:\Test\folder1" "\\remote_machine\destination" -Recurse
  • Copy-Item "C:\Test\folder2\*" "\\remote_machine\destination" -Recurse
  • 关于powershell - 目的地的复制项目问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3968235/

    相关文章:

    python - 错误 : _tkinter. TclError:无法调用 "wm"命令:应用程序已被销毁

    linux - linux中find和sed命令的错误?

    powershell - YAML 中 CloudFormation 模板中的加入功能未按预期工作

    powershell - Git Shell忽略了我的Powershell配置文件中的自定义提示

    c# - 加载 System.Management.Automation 程序集时出错

    powershell - 编写 PowerShell 帮助时如何使用 .PARAMETER?

    powershell - 如何找到 SOAP API 的 WSDL 接口(interface)? -电源外壳

    windows - 将命令行变量写入文本文件

    带有位置参数的 Git 别名

    WPF 按钮命令绑定(bind)已刷新,但按钮仍处于禁用状态