8,330 questions
Your code is very difficult to read. When posting code, you should use the Code Sample tool, the 101010 icon. And you should also indent your statements to make it easier to see what code is part of which statement. You have everything shifted to the leftmost column.
Your Show-Menu function doesn't do much. I don't see much value in making that a function. You would be better off by putting the application part of your code into functions.
Organize your script like this.
function Process1 {
Write-Host ""
Write-Host "Do option 1 here."
Write-Host ""
}
function Process2 {
Write-Host ""
Write-Host "Do option 2 here."
Write-Host ""
}
$loop = $true
While ($loop) {
Write-Host "Enter 1 to do option 1."
Write-Host "Enter 2 to do option 2."
Write-Host "Enter q to quit."
$select = Read-Host
switch ($select) {
'1' { Process1 }
'2' { Process2 }
'q' { $loop = $false }
Default { Write-Host "Invalid selection." }
}
}