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

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