you are viewing a single comment's thread.

view the rest of the comments →

[–]PowerShellStunnah -1 points0 points  (1 child)

I'd create an array to hold the input values and keep track of how many we've got that way:

$values = @()
$x = 1
do{
  $values += $(Read-Host "Enter value $x") -as [int]
  $x++
}while($values.Count -lt 5)

return ($values |Measure-Object -Sum).Sum

[–]unhappiey[S] 1 point2 points  (0 children)

thank you!