RosettaCodeData/Task/Guess-the-number/PowerShell/guess-the-number-1.ps1
2026-04-30 12:34:36 -04:00

12 lines
358 B
PowerShell

Function GuessNumber($Guess)
{
$Number = Get-Random -min 1 -max 11
Write-Host "What number between 1 and 10 am I thinking of?"
Do
{
Write-Warning "Try again!"
$Guess = Read-Host "What's the number?"
}
While ($Number -ne $Guess)
Write-Host "Well done! You successfully guessed the number $Guess."
}