A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/microsoft/PowerShellForGitHub/commit/683187a94f05b7c69bc6ca3459ce615936f5a0d2 below:

Fix handling of numerical configuration properties across PS5 and PS7… · microsoft/PowerShellForGitHub@683187a · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+4

-2

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+4

-2

lines changed Original file line number Diff line number Diff line change

@@ -466,16 +466,18 @@ function Resolve-PropertyValue

466 466

if ($Type -eq 'Boolean') { $typeType = [Boolean] }

467 467

if ($Type -eq 'Int32') { $typeType = [Int32] }

468 468

if ($Type -eq 'Int64') { $typeType = [Int64] }

469 +

$numberEquivalents = @('Int32', 'Int64', 'long', 'int')

469 470 470 471

if (Test-PropertyExists -InputObject $InputObject -Name $Name)

471 472

{

472 -

if ($InputObject.$Name -is $typeType)

473 +

if (($InputObject.$Name -is $typeType) -or

474 +

(($Type -in $numberEquivalents) -and ($InputObject.$Name.GetType().Name -in $numberEquivalents)))

473 475

{

474 476

return $InputObject.$Name

475 477

}

476 478

else

477 479

{

478 -

$message = "The locally cached $Name configuration was not of type $Type. Reverting to default value."

480 +

$message = "The locally cached $Name configuration was not of type $Type (it was $($InputObject.$Name.GetType())). Reverting to default value."

479 481

Write-Log -Message $message -Level Warning

480 482

return $DefaultValue

481 483

}

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4