Skip to content

Commit

Permalink
perhaps v2 will be happy now
Browse files Browse the repository at this point in the history
  • Loading branch information
mwrock committed Oct 30, 2015
1 parent 8e73176 commit 64a47d8
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Functions/Mock.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -831,17 +831,23 @@ function Select-NonPipelinedBoundParameters {
}
$testMatch = ($testVal -eq $lastInput)
if($testMatch.Gettype() -ne [bool]) {
$testMatch = ($testVal.GetHashCode() -eq $lastInput.GetHashCode())
$testMatch = ((Compare-Object $testVal $lastInput -ExcludeDifferent) -eq $null)
}
if($testMatch) { $match = $true }
}
if(($paramAttributes | ? { $_.ValueFromPipelineByPropertyName }) -and $lastInput.$_ -ne $null){
$testMatch = ($BoundParameters[$_] -eq $lastInput.$_)
if($testMatch.Gettype() -ne [bool]) {
$testMatch = ((Compare-Object $BoundParameters[$_] $lastInput.$_ -ExcludeDifferent) -eq $null)
}
if($testMatch) {
$match = $true
if($paramAttributes | ? { $_.ValueFromPipelineByPropertyName }){
$hasProperty = $false
try { $hasProperty = $lastInput.$_ } catch { }

# Get-Member takes too long
if($hasProperty) {
$testMatch = ($BoundParameters[$_] -eq $lastInput.$_)
if($testMatch.Gettype() -ne [bool]) {
$testMatch = ((Compare-Object $BoundParameters[$_] $lastInput.$_ -ExcludeDifferent) -eq $null)
}
if($testMatch) {
$match = $true
}
}
}

Expand Down

0 comments on commit 64a47d8

Please sign in to comment.