I am trying to write a script that counts down any number a user puts in.
Write-Host "$Value1"
[int]$Value1 - [int]1
do {
$outputString = read-host
$outputString - [int]1
}
until ($outputstring=0)
$Value1 defines the number a user puts in. It seems to me that the initial value gets subtracted by 1, and after that the $outputString should take the read-host information and subtract 1 untill it reaches 0.
At this point in time the only output I get is the Write-Host “[int]$Value1 - [int]1“, and the output subtracted by 1. However it does not loop untill it reaches 0.
Any way to fix this problem ?
Greetings
How about this?