Fix Copy-Item progress to only show completed when all files are copied (#20517)

This commit is contained in:
Steve Lee
2023-10-19 10:36:47 -07:00
committed by GitHub
parent 31cccab3ec
commit 581ee201a7
@@ -3569,7 +3569,7 @@ namespace Microsoft.PowerShell.Commands
}
CopyItemLocalOrToSession(path, destinationPath, recurse, Force, null);
if (_totalFiles > 0)
if (Stopping || _copiedFiles == _totalFiles)
{
_copyStopwatch.Stop();
var progress = new ProgressRecord(COPY_FILE_ACTIVITY_ID, " ", " ");