Resolved #29: PercentComplete has been capped to 100.

This commit is contained in:
MichaelGrafnetter 2016-09-28 17:11:43 +02:00
parent c6fb24c78c
commit e21c85812f
4 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,6 @@
Version 2.17.1
- [Module] Fixed a bug in progress reporting of the Get-ADReplAccount cmdlet.
Version 2.17
- [Module] The Get-ADReplAccount -All command now reports replication progress.
- [Framework] Added the ability to retrieve the replication cursor.

View File

@ -84,7 +84,9 @@
// Update the progress after each replication cycle
ReplicationProgressHandler progressReporter = (ReplicationCookie cookie, int processedObjectCount, int totalObjectCount) =>
{
progress.PercentComplete = (int) (((double)processedObjectCount / (double)totalObjectCount) * 100);
int percentComplete = (int)(((double)processedObjectCount / (double)totalObjectCount) * 100);
// AD's object count estimate is sometimes lower than the actual count, so we cap the value to 100%.
progress.PercentComplete = Math.Min(percentComplete, 100);
this.WriteProgress(progress);
};

View File

@ -8,7 +8,7 @@
RootModule = 'DSInternals.psm1'
# Version number of this module.
ModuleVersion = '2.17'
ModuleVersion = '2.17.1'
# ID used to uniquely identify this module
GUID = '766b3ad8-eb78-48e6-84bd-61b31d96b53e'
@ -117,7 +117,7 @@ PrivateData = @{
# ReleaseNotes of this module
ReleaseNotes = @"
- The Get-ADReplAccount -All command now reports replication progress.
- Fixed a bug in progress reporting of the Get-ADReplAccount cmdlet.
"@
} # End of PSData hashtable

View File

@ -5,8 +5,8 @@ using System.Runtime.InteropServices;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DSInternals PowerShell Commands")]
[assembly: AssemblyVersion("2.17")]
[assembly: AssemblyFileVersion("2.17")]
[assembly: AssemblyVersion("2.17.1")]
[assembly: AssemblyFileVersion("2.17.1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]