diff --git a/GitHubConfiguration.ps1 b/GitHubConfiguration.ps1 index 7c50f858..944b2621 100644 --- a/GitHubConfiguration.ps1 +++ b/GitHubConfiguration.ps1 @@ -466,16 +466,18 @@ function Resolve-PropertyValue if ($Type -eq 'Boolean') { $typeType = [Boolean] } if ($Type -eq 'Int32') { $typeType = [Int32] } if ($Type -eq 'Int64') { $typeType = [Int64] } + $numberEquivalents = @('Int32', 'Int64', 'long', 'int') if (Test-PropertyExists -InputObject $InputObject -Name $Name) { - if ($InputObject.$Name -is $typeType) + if (($InputObject.$Name -is $typeType) -or + (($Type -in $numberEquivalents) -and ($InputObject.$Name.GetType().Name -in $numberEquivalents))) { return $InputObject.$Name } else { - $message = "The locally cached $Name configuration was not of type $Type. Reverting to default value." + $message = "The locally cached $Name configuration was not of type $Type (it was $($InputObject.$Name.GetType())). Reverting to default value." Write-Log -Message $message -Level Warning return $DefaultValue }