Add to Technorati Favorites
Welcome to ThePowerShellGuy.com Sign in | Join | Help

PowerShell and Robocopy part 2

In last post we made a RoboCopy help Object

We are going to use that later on, but first we make a sample Robocopy Job :

 

#############################################################################################
## Robocopy example command :
#############################################################################################


robocopy 'c:\Documents and Settings' c:\PowerShellRoboTest /r:2 /w:5 /s /v /np |
  Tee-Object -Variable RoboLog

What we are doing here is starting a Robocopy Job and we also capture the output from robocopy in the variable $robolog.

for the given parameters /NP is an important one, it means "No Process indicator" as this messes up the output.

With the $RoboHelpObject from the first post in this series we can find out what the rest of the parameters mean like this :

image 
not very handy yet, but later on in this series we will use this object, to make a more "fancy" way to start the Robocopy job.
We will create a form to help us creating a Robocopy command, as we can  generate the Robocopy command from a form that uses this Help object : 
image 

but for now you can change the directories to valid ones for testing out robocopy command (I picked a directory where I was sure some files would be in use, guess why ;-) ), and we will first go on with the output of the example robocpoy command, in the next post we will also parse the output of robocopy into an Object so that we can do some analyzing  on it from PowerShell (and also process saved Robocopy Logs) , after that I go on about how I created the Form above.

Enjoy,

Greetings /\/\o\/\/

Published Thursday, September 18, 2008 12:31 PM by MoW
Filed under: ,

Comments

# Episode 42 - with Greg Shields « PowerScripting Podcast

Tuesday, September 23, 2008 10:40 PM by Episode 42 - with Greg Shields « PowerScripting Podcast

# Weekly news from The PowerShell world

Hi, and welcome to the first of many weekly news post from the PowerShell world. By The Scandinavian

Wednesday, September 24, 2008 7:53 AM by The Wall

# PowerShell and Robocopy part 5

  I this part I will cover the code for the "PowerShell Robocopy GUI" as shown in PowerShell

Wednesday, October 01, 2008 4:37 PM by The PowerShell Guy
Anonymous comments are disabled