diff --git a/Changelog.txt b/Changelog.txt index 38d8865..e970bc7 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -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. diff --git a/Src/DSInternals.PowerShell/Commands/Replication/GetADReplAccountCommand.cs b/Src/DSInternals.PowerShell/Commands/Replication/GetADReplAccountCommand.cs index 7158dbb..1b3ccb4 100644 --- a/Src/DSInternals.PowerShell/Commands/Replication/GetADReplAccountCommand.cs +++ b/Src/DSInternals.PowerShell/Commands/Replication/GetADReplAccountCommand.cs @@ -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); }; diff --git a/Src/DSInternals.PowerShell/DSInternals.psd1 b/Src/DSInternals.PowerShell/DSInternals.psd1 index 17e103f..7ca71e4 100644 --- a/Src/DSInternals.PowerShell/DSInternals.psd1 +++ b/Src/DSInternals.PowerShell/DSInternals.psd1 @@ -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 diff --git a/Src/DSInternals.PowerShell/Properties/AssemblyInfo.cs b/Src/DSInternals.PowerShell/Properties/AssemblyInfo.cs index 44b4de0..4d0f8b7 100644 --- a/Src/DSInternals.PowerShell/Properties/AssemblyInfo.cs +++ b/Src/DSInternals.PowerShell/Properties/AssemblyInfo.cs @@ -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("")]