Shell – Prompting for and accepting input in Windows PowerShell

powershell

In a trivia script, how would you enter a fill in the blank question and an answer like the Seinfeld trivia game in Programming for Beginners?

Best Answer

As well as Read-Host you can directly use the System.Console class, to read a single character (without needing ENTER):

$key = [Console]::ReadKey()
$char = $key.KeyChar
Related Question