I have PowerShell console script (Not GUI) that has the following code:
$Servername = Read-host -Prompt "What is the server name?"
However, when running the script I want to type a few characters at time and have it lookup in external text file called servernames.txt
for matches and the more characters I have the finer the results (Ideally I want to be able to select the match directly from the dynamic lookup).
The purpose is to facilitate typing names of hundreds of servers, as you wouldn't need to remember every name, because the servernames.txt
file will have the whole server inventory.
I thought about Out-GridView
, but not sure that would work in console script. Ideally should not pop-up another window.