Procházet zdrojové kódy

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 před 6 roky
committed by GitHub
rodič
revize
168b8b4465
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. +2
    -2
      NTFSSecurity/ItemCmdlets/CopyItem2.cs

+ 2
- 2
NTFSSecurity/ItemCmdlets/CopyItem2.cs Zobrazit soubor

@@ -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();
}
}
}
}

Načítá se…
Zrušit
Uložit