Powershell xcopy for file backup

A handy powershell script for xcopying data – useful for database backups that need copying to tape: function xCopy([string]$src = $(throw "Specify the source directory"),[string]$dest = $(throw "Specify the destination diirectory")){$src = $src -replace '\*$'if (test-path $dest){switch -regex ($src){'\\$' {$src = "$src*"; break}'\w$' {$src = "$src\*"; break}default {break}}}copy-item $src $dest -recurse -force}xCopy "C:\Source Folder\Location" "\\servername\foldershare\valid... Continue Reading →

A WordPress.com Website.

Up ↑