|
@@ -4,14 +4,19 @@ function backup_aragorn {
|
|
|
|
|
|
param(
|
|
|
[switch]$diskoverride,
|
|
|
- [switch]$skipappdir)
|
|
|
+ [switch]$skipappdir,
|
|
|
+ [string]$usedisk=$null)
|
|
|
|
|
|
|
|
|
. (Join-Path $PSScriptRoot handle_exclude_lists.ps1)
|
|
|
$myName = $env:COMPUTERNAME
|
|
|
|
|
|
# Identify the backup disk
|
|
|
- ($backupDisk, $partial) = check_disk $diskoverride
|
|
|
+ if ($usedisk) {
|
|
|
+ ($backupDisk, $partial) = get_specific_disk $usedisk
|
|
|
+ } else {
|
|
|
+ ($backupDisk, $partial) = check_disk $diskoverride
|
|
|
+ }
|
|
|
|
|
|
# Backup folder
|
|
|
$backup_dir = "$HOME\Local"
|
|
@@ -107,6 +112,12 @@ function check_disk($diskoverride=$false) {
|
|
|
return ($backupDisk.DeviceID, $partialBackup)
|
|
|
}
|
|
|
|
|
|
+function get_specific_disk($letter) {
|
|
|
+ $backupDisk = Get-WmiObject -Class Win32_LogicalDisk | Where-Object {$_.DeviceID -imatch $letter}
|
|
|
+
|
|
|
+ # Return the disk letter and whether to do the full backup
|
|
|
+ return ($backupDisk.DeviceID, $false)
|
|
|
+}
|
|
|
|
|
|
|
|
|
function customLogger($backupDisk, $myName) {
|