33 lines
811 B
PowerShell
33 lines
811 B
PowerShell
function Test-Passthrough {
|
|
<#
|
|
.SYNOPSIS
|
|
Returns the first value in the arguments list
|
|
|
|
.DESCRIPTION
|
|
Mostly useful for forcing a test result to true or false
|
|
|
|
.PARAMETER result
|
|
Ignored entirely
|
|
|
|
.PARAMETER expect
|
|
Returned value
|
|
|
|
.PARAMETER message
|
|
Optional message to be returned
|
|
|
|
.EXAMPLE
|
|
$passedTest = (Test-Should -Result $webRequest -Predicate ${function:Test-Passthrough} $false "Test was invalid")
|
|
|
|
.NOTES
|
|
Returns the value of $expect
|
|
#>
|
|
[cmdletbinding()]
|
|
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter", '', Justification="This is a test function; it's supposed to have an unused param", Scope = "Function")]
|
|
param(
|
|
$result,
|
|
$expect,
|
|
$message
|
|
)
|
|
$expect
|
|
$message
|
|
} |