Hi Jon,
here is an example:
$text = Get-Content D:\test1.txt
$prompt = Read-Host -Prompt 'number '
if($prompt -in $text)
{
Write-Host 'welcome!' -ForegroundColor Green
}else{
Write-Host 'please try again...' -ForegroundColor Red
}
Best regards,
Andy
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact
tnmff@microsoft.com.