Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Log file

$
0
0

Hi gurus

 here I am back again, requesting an easy help from you ,

 

I have a small easy process that reads machine names from a text file I use get-content in order to achieve that and then I use a foreach statement to go and push this new file into the machines, but I would like to create a log file while it does the process, so I can compare later and check if a machine was missed.

how can i accomplish this

so far what I have is:

 

get-content $machinefile | foreach { copy-item $filetocopy  \\$_\c$\$filelocation }

how can I log every machine that the foreach goes through?

 

Thanks a bunch

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles