copy-item -Path <network folder> -Destination env:AppData + "\Roaming
\Microsoft"
As you no doubt guessed, this is my first foray into Powershell.
Thanks,
How about this:
copy-item -path <network folder> -dest (join-path $env:appdata
"\Roaming\Microsoft") -whatif
Using "-whatif" allows you to see what would happen if the command was
actually run.
Marco
--
*Microsoft MVP - Admin Frameworks
https://mvp.support.microsoft.com/profile/Marco.Shaw
*Co-Author - Sams Windows PowerShell Unleashed 2nd Edition (due December
15th, 2008)
*PowerShell Co-Community Director - http://www.powershellcommunity.org
*Blog - http://marcoshaw.blogspot.com
---
Shay Levy
Windows PowerShell MVP
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Toolbar: http://tinyurl.com/PSToolbar
I'll back up Marco on this one ... using Join-Path is safer, and will
adjust for when you have too many (or too few) slashes (ie: if the
environment variable has a trailing slash and you add one in your
string) so it's safer than just concatenating strings.
However, if you're sure you don't need the extra safety ... it's
certainly simpler to just use "$env:AppData\Roaming\Microsoft" or,
more correctly, the curly-brace content notation: "${Env:AppData}
\Roaming\Microsoft"
--
Joel
Thanks for all your replies, folks. It's working now.