Skip to content

Commit 29aac7a

Browse files
Fix the exception "Item has already been added" (#424)
* Fix the exception "Item has already been added" Fixes the exception "Item has already been added. Key in dictionary: 'x' Key being added: 'x'" For the Plugin Invoke-IcingaCheckDiskHealth and potentially others too. Related to #327, which has been closed, but is still an issue for us on some machines. * Update 31-Changelog.md Updates changelog --------- Co-authored-by: Lord Hepipud <[email protected]>
1 parent 1570c58 commit 29aac7a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

doc/31-Changelog.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ documentation before upgrading to a new release.
77

88
Released closed milestones can be found on [GitHub](https://github.com/Icinga/icinga-powershell-plugins/milestones?state=closed).
99

10-
## 1.13.0 Beta-2 (2024-09-19)
10+
## 1.13.0 (2025-01-30)
1111

1212
[Issue and PRs](https://github.com/Icinga/icinga-powershell-plugins/milestone/21)
1313

14-
### Enhancements
14+
### Bugfixes
15+
16+
* [#424](https://github.com/Icinga/icinga-powershell-plugins/pull/424) Fixes exception "Item has already been added" for `Invoke-IcingaCheckDiskHeath`
1517

1618
### Bugfixes
1719

provider/disks/Get-IcingaPhysicalDiskInfo.psm1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ function Global:Get-IcingaPhysicalDiskInfo()
285285
}
286286
);
287287

288-
$PhysicalDiskData.Add($MSFTDiskId, $DiskInfo);
288+
if(!$PhysicalDiskData.ContainsKey($MSFTDiskId)) {
289+
$PhysicalDiskData.Add($MSFTDiskId, $DiskInfo);
290+
}
289291
}
290292

291293
return $PhysicalDiskData;

0 commit comments

Comments
 (0)