Powershell- Wait for x seconds on read host -
how wait x seconds on read host in powershell? i'm trying achieve xis prompt user input x seconds, if user doesn't enter value needed. use default value.
currently when use read-host waiting on user input indefinitely, want have timeout on it. how can achieve this. code have below. im unable find option lets me define timer on this.
$input = read-host ("enter y or n") if(!input) { $input = y }
this regarding possible duplicate question:
in post answers directed more towards whether user pressed key or not. did not mention how capture user input in there use it?
Comments
Post a Comment