简体   繁体   English

Start-BitsTransfer的“目标”字段不是必填项

[英]Start-BitsTransfer's Destination field is not mandatory

I had a bug in a script where I'd specified -Description $dest instead of -Destination $dest on a call to Start-BitsTransfer . 我在脚本中有一个错误,该脚本在对Start-BitsTransfer的调用中指定了-Description $dest而不是-Destination $dest It didn't error / ran quickly for a small file and took a while for a large one. 它没有出错/只为一个小文件快速运行,花了一段时间才运行一个大文件。 As such I think the file was copied to my machine; 因此,我认为文件已复制到我的机器上。 I just can't find where it was copied to... 我只是找不到它的复制位置...

Question

  • Why isn't Destination a mandatory field? 为什么“目的地”不是必填字段?
  • Where do files go by default / when Destination isn't specified? 默认情况下/未指定目标时文件会去哪里?

The snarky answer to the first part of your question would probably be "because Microsoft said so". 对您的问题的第一部分的nar昧答案可能是“因为微软这样说”。 Since I wasn't involved in the decision making I can't give you a definitive answer, but example 7 of the cmdlet documentation mentions that 由于我没有参与决策,因此无法给您确切的答案,但是cmdlet 文档的示例7提到

The destination path cannot use wildcard characters. 目标路径不能使用通配符。 The destination path supports only a relative directory, a rooted path, or an implicit directory (the current directory). 目标路径仅支持相对目录,根目录路径或隐式目录(当前目录)。

So I would suspect that the parameter was made optional to allow transferring files "here" (to the current working directory) without having to explicitly specify a destination, ie for simplicity of use. 因此,我怀疑该参数是否为可选参数,以允许在“此处”(到当前工作目录)中传输文件,而不必显式指定目的地,即为了简化使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM