简体   繁体   中英

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 . 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". 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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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