Explorar el Código

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 hace 7 años
committed by GitHub
padre
commit
168b8b4465
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. +2
    -2
      NTFSSecurity/ItemCmdlets/CopyItem2.cs

+ 2
- 2
NTFSSecurity/ItemCmdlets/CopyItem2.cs Ver fichero

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

Cargando…
Cancelar
Guardar