Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions GitHubConfiguration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down