Saturday, April 27, 2013
Backup Script
In my last post, I mentioned that I was going to write up some of the utility scripts I have on my VM. The first one is pretty simple. It's a little PowerShell script to zip up the My Documents folder on the VM, and copy it to the physical machine. (I'm using 7-Zip.)

There are a few things in this script that are pretty common tasks that I need to do when using PowerShell, so this is a good thing to put up on the blog for reference. Just to point out those things:
  1. Creating a file name that contains the current date.
  2. Running a command that's in a string variable.
  3. Prompting to "press any key" when done, so the user can see error messages, if the script is being run from a desktop icon.
  4. Giving an option to skip the "press any key" prompt, when the command is run unattended from task scheduler.


posted by Unknown 8:00 AM

Comments: Post a Comment

This page is powered by Blogger. Isn't yours?
© 2011 Andrew Huey