First off, don't assume you can't use wildcards with the -Destination parameter. It's in the help: All you have to do is enter Get-Help Copy-Item -ShowWindow and scroll down to the -Destination parameter. Although your assumption is correct (this time ;)), you never had to assume in the first place.
I saw your same problem posted somewhere else too, and I'm having a little problem following, especially when you said the PCs are local and not remote. Do you intend to run the script on one computer and have it copy the file to the other computers? If so, then the PCs in your classroom are in fact remote (even if you can see them from your desk). There's only one local computer, and that's the one you're using. If they are remote, then you may need your destination to be a UNC ("\\$computer\C$\Users\..."). I just noticed, you don't even use your $computer variable inside your Foreach statement. Notice that in the UNC partial example I just wrote, that it was actually included.
I rather like Will's suggestion–one document for all the users instead of the same document for each. If you did this your way, then new users would never see the document unless you reran your script. And then what happens when the document is updated? It would be much easier to replace one document then all of the them. Something to consider. Good luck!
The topic ‘Script to copy 1 folder to multiple computers’ is closed to new replies.