RosettaCodeData/Task/Send-an-unknown-method-call/PowerShell/send-an-unknown-method-call.ps1
2026-04-30 12:34:36 -04:00

10 lines
318 B
PowerShell

$method = ([Math] | Get-Member -MemberType Method -Static | Where-Object {$_.Definition.Split(',').Count -eq 1} | Get-Random).Name
$number = (1..9 | Get-Random) / 10
$result = [Math]::$method($number)
$output = [PSCustomObject]@{
Method = $method
Number = $number
Result = $result
}
$output | Format-List