Author Posts

January 5, 2018 at 6:14 pm

Hi, I'm looking for the best way to copy over the contents of a users my documents folder from one remote computer to another with the possibility of being able to display with a gridview or output to a csv the files that were copied over. Thanks for any help in advance.

January 5, 2018 at 6:29 pm

Happy to try and help, but I think you'll find a greater response rate if you're asking a concrete technical question. Is there some particular part of the overall task you're stuck on, for example?

January 5, 2018 at 7:32 pm

Here is a function I created. How can I get a listing of the files that were copied over so I can display them in a gridview or export to a csv? Thanks for any help.

Function MYDOCS
{
$computernameS = '6yypqg23'
	$computernameCT = '6WGPQG23'
	$userid = 'x8921'
				
		$source = "\\$computernameS\c$\Users\$userid\documents\*"
		
		$destination = "\\$computernameCT\c$\Users\$userid\documents\"
Copy-Item -Recurse -path $source -destination $destination -Force -Exclude @("my*") | Out-GridView –Title "SOFTWARE INSTALLED CHECK FOR  "
}

January 5, 2018 at 8:03 pm

Copy-Item doesn't normally produce output, which is why your Grid gets nothing. Add the -PassThru parameter so it'll output file objects for each file it acted on.

January 6, 2018 at 6:47 pm

Thanks for your help Don.