Powershell question

unwantedSN

Weaksauce
Joined
Jan 9, 2009
Messages
100
I wasnt sure where to put this but I know a lot of you here use power shell. Im having issues trying to wrap my head around the correct syntax and thought maybe some of you could help. In a nutshell im trying to copy a file from one path to another, but its a bit weird. What i need to happen is to copy from my source to multiple destinations. I need to go from c:\newfolder\file.ext to d:\employeefolders\unkown_variable\newfolder\filename.ext

The\unknown_variable\ folder is consistently changing the only thing that i need it to do is put my test\file.ext directory in there if their is a folder.

here is what i tried, but it fails.

PS C:\> Copy-Item C:\test\testfile.txt d:\employeefolders\*\test\

anyone know how to make this work?
 
Get-ChildItem -Recurse -Path c:\temp | ?{ $_.PSIsContainer } |forEach-Object{copy-item c:\temp\text.txt $_ }

This doesn't do what you want, but it will give you a start, fi i have mroe time ill figure out the exact answere
 
Back
Top