Pārlūkot izejas kodu

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 pirms 7 gadiem
committed by GitHub
vecāks
revīzija
168b8b4465
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. +2
    -2
      NTFSSecurity/ItemCmdlets/CopyItem2.cs

+ 2
- 2
NTFSSecurity/ItemCmdlets/CopyItem2.cs Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt