<p>I am writing a script for MS PowerShell.  This script uses the <code>Copy-Item</code> command.  One of the optional arguments to this command is "<code>-container</code>". The documentation for the argument states that specifying this argument "Preserves container objects during the copy operation."</p>

<p>This is all well and good, for I would be the last person to want unpreserved container objects during a copy operation.  But in all seriousness, what does this argument do?  Particularly in the case where I am copying a disk directory tree from one place to another, what difference does this make to the behavior of the <code>Copy-Item</code> command?</p>

The container the documentation is talking about is the folder structure.  If you are doing a recursive copy and want to preserve the folder structure, you would use the -container switch. (Note: by default the -container switch is set to true, so you really would not need to specify it.  If you wanted to turn it off you could use
```
-container: $false
```
.)
There is a catch to this... if you do a directory listing and pipe it to Copy-Item, it will not preserve the folder structure.  If you want to preserve the folder structure, you have to specify the -path property and the -recurse switch.