Skip to content

Commit

Permalink
Update src/System.Management.Automation/namespaces/FileSystemProvider.cs
Browse files Browse the repository at this point in the history
Co-authored-by: Dominik Kaszewski <dakaszewski@gmail.com>
  • Loading branch information
SteveL-MSFT and dkaszews committed Jan 25, 2023
1 parent 2efe017 commit 614f70e
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3937,11 +3937,7 @@ private void CopyFileInfoItem(FileInfo file, string destinationPath, bool force,
StringUtil.Format(FileSystemProviderStrings.CopyingLocalFileActivity, _copiedFiles, _totalFiles),
StringUtil.Format(FileSystemProviderStrings.CopyingLocalBytesStatus, Utils.DisplayHumanReadableFileSize(_copiedBytes), Utils.DisplayHumanReadableFileSize(_totalBytes), speed)
);
var percentComplete = (int)((_copiedBytes * 100) / _totalBytes);
if (percentComplete > 100)
{
percentComplete = 100;
}
var percentComplete = (int) Math.Min(_copiedBytes * 100 / _totalBytes, 100);
progress.PercentComplete = percentComplete;
progress.RecordType = ProgressRecordType.Processing;
WriteProgress(progress);
Expand Down

0 comments on commit 614f70e

Please sign in to comment.