Conversation
Wrap per-server New-CimSession + scope collection in try/catch blocks in both Get-AbrADDHCPDomain and Get-AbrADDHCPStandAlone. Rename the CIM session variable in Get-AbrADDHCPInfrastructure to avoid collision with the parent scope. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix: CIM session failures crash entire report sections
ConvertTo-TextYN and ConvertTo-EmptyToFiller declare their $TEXT
parameter as [string] with [AllowEmptyString()] but not [AllowNull()].
Passing $null tripped the parameter binder before the function body ran,
raising "Cannot process argument transformation on parameter 'TEXT'.
Cannot convert value to type System.String." The existing `$Null`
switch case was therefore unreachable. DHCP properties that come back
null (e.g. failover AutoStateTransition/EnableAuth, option-definition
MultiValued) produced these errors and left blank report cells.
Adding [AllowNull()] lets null reach the body and render as "--".
ConvertTo-HashToYN enumerated an undefined $inObj variable instead of
its $TEXT parameter, so it never converted the supplied hashtable.
Get-AbrADDHCPDomain called Get-ADDomain before testing the domain
value, so an empty element from $OrderedDomains.split(" ") raised
"Cannot validate argument on parameter 'Identity'. The Identity
property on the argument is null or empty." Guard the value first and
test the lookup result ($DomainInfo) instead.
Fix null-handling errors in DHCP report generation
…am.VBR/ subdirectory
| Paragraph "The following section provides a summary of the Dynamic Host Configuration Protocol." | ||
| $DHCPinDC = ($DHCPinDomain | Where-Object { $_.DnsName.split(".", 2)[1] -eq $DomainInfo.DNSRoot -and $_.DnsName -notin $Options.Exclude.DCs }).DnsName | ||
| Paragraph 'The following section provides a summary of the Dynamic Host Configuration Protocol.' | ||
| $DHCPinDC = ($DHCPinDomain | Where-Object { $_.DnsName.split('.', 2)[1] -eq $DomainInfo.DNSRoot -and $_.DnsName -notin $Options.Exclude.DCs }).DnsName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[0.3.0] - [2026-06-18]
Added
Changed
Fixed
ConvertTo-TextYNandConvertTo-EmptyToFillerthrowing on$nullinput by adding[AllowNull()]to the$TEXTparameter, so null values render as--instead of raising "Cannot process argument transformation on parameter 'TEXT'"ConvertTo-HashToYNiterating an undefined$inObjvariable instead of its$TEXTparameterGet-ADDomaininGet-AbrADDHCPDomainto avoid "Identity property on the argument is null or empty" errorsConvertTo-HashToYNcmdlet not respecting hash table ordering