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

This commit is contained in:
Aditya Patwardhan
2023-10-19 15:03:42 -07:00
committed by GitHub
parent 3ea6496813
commit 9e8a5cc033
@@ -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, " ", " ");