I am very new to Powershell and coding. To my understanding, the input from a Read-Host cmdlet can be piped into a variable. I would like prompt the user to enter a number greater than 5 If -gt 5 it Write-Host Yes elseif -lt 5 no. For some reason no matter what number I select I get no. If goes straight to elseif. Can anyone help?
$A = Read-Host "Enter number greater than 5"
If ($A -gt 5)
{
Write-Host "yes"
}
elseif ($A -lt 5)
{
Write-Host "no"
}