Quellcode durchsuchen

Don't throw error when 'Force' switch is specified

This fixes error when 'Copy-Item2 -Force' would not overwrite existing files
tags/4.2.4
Kris Borowinski vor 6 Jahren
committed by GitHub
Ursprung
Commit
168b8b4465
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. +2
    -2
      NTFSSecurity/ItemCmdlets/CopyItem2.cs

+ 2
- 2
NTFSSecurity/ItemCmdlets/CopyItem2.cs Datei anzeigen

@@ -85,7 +85,7 @@ namespace NTFSSecurity
actualDestination = destination;
}

if (File.Exists(actualDestination))
if (!force & File.Exists(actualDestination))
{
WriteError(new ErrorRecord(new AlreadyExistsException(), "DestinationFileAlreadyExists", ErrorCategory.ResourceExists, actualDestination));
return;
@@ -129,4 +129,4 @@ namespace NTFSSecurity
base.EndProcessing();
}
}
}
}

Laden…
Abbrechen
Speichern