GEORGE TRIFONOV Home Developer Corner Contact Resume 
Theme
Login
 
 
Powershell file copy example. Copy-Item code snippet

Probably the first scheduled task you want to do is to periodically copy files from one location to another.
Here the small snippet how to do it in powershell:

   1: # defining log destination
   2: $dest ="C:\somedirectory" 
   3:  
   4: #Creating destination directory
   5: New-Item $dest -type directory -force 
   6:  
   7: #File to copy
   8: $iis ="D:\logs\iislog.log"
   9:  
  10: #Performing copy operation
  11: Copy-Item $iis $dest
Share this post: email it! | bookmark it! | digg it! | kick it! | live it!
Posted: Thu, 17 Apr 2008 14:11:15 GMT By: Gtrifonov