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 :
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 :
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\/\/