UPDATE: This posting has been updated with a zip file that contains two versions of the script. The file "bitsbackup.ps1" is intended for use with Windows 7 RC version of BITS cmdlets and the file "bitsbackup-ctp3.ps1" is intended for use with Windows 7 Beta or PowerShell 2.0 CTP 3 version of BITS cmdlets.
Here we have a sample PowerShell script for copying a directory to another UNC path. What's so special about this, you say? This scripts uses BITS PowerShell cmdlets; which means that you can backup a folder to a network location while preserving the responsiveness of other network apps.
This example is based on the Win7
beta RC version of the BITS Powershell cmdlets.
How to Use:
- Load this script by running: Import-Module <location of script>\bitsbackup.ps1
- Usage example: Backup-Directory .\myfolder \\backupserver\sharename -recurse
- This will create a copy of myfolder under \\backupserver\sharename\myfolder
- For more help: Get-Help Backup-Directory
Alex Ng [MSFT]