diff --git a/properBackup.ps1 b/properBackup.ps1 index ea7756cfc8840cd924d889acc18a80b5dee796e3..988d8a41809cd9c414d87634d2c5f81998e78743 100644 --- a/properBackup.ps1 +++ b/properBackup.ps1 @@ -19,7 +19,6 @@ function doBackup { New-Item -Path $incBackupFolderLocation -Name "inBackup" -ItemType "directory" $differences | Where-Object {$_.SideIndicator -eq "<="} | ForEach-Object { #Venstrepil betyr at filen bare er i backup. Fjerner først filer. Mapper kopieres over i incremental. $relativePathFromSourceFolder = $_.Fullname.split($newestBackup.FullName)[1]; - Write-Output "wwww"$_.Fullname.split($newestBackup.FullName)[1] $fullPathAtIncBackupLocation = Join-Path -Path $incBackupFolderLocation -ChildPath "inBackup" $relativePathFromSourceFolder Copy-Item $_.FullName -Destination $fullPathAtIncBackupLocation -Force Write-Output $_.FullName @@ -96,7 +95,6 @@ function doRestore { $newestBackupzip = Get-ChildItem $backupLocation | Where-Object {$_.Name -match "Backup_"} | Where-Object {$_.Extension -match "zip"} | Select-Object -First 1 #Finner nyeste backup zip. Expand-Archive $newestBackupzip (Join-Path -Path $newestBackupzip.Directory -ChildPath $newestBackupzip.BaseName) $newestBackup = Get-ChildItem $backupLocation | Where-Object {$_.Name -match "Backup_"} | Where-Object {$_.Name -notmatch "-Increment"} | Select-Object -First 1 - Write-Output ($incrementalsToApply -is [int]) if ($incrementalsToApply -is [int]) { $incrementalBackups = Get-ChildItem $backupLocation | Where-Object {$_.Name -match "-Increment"} | Select-Object -First $incrementalsToApply $incrementalBackups | ForEach-Object {