Hello I am trying to create a powershell menu that has options within it to run at a press of an option. However I am stuck where if I run the ping option the response comes in for a brief half a second and not sure why it disappears right away. Any advice or help appreciated! Im new to powershell still trying to get the hang of it using examples and things researched. If any learning advice im open ears as well!
Function Menu
{
Clear-Host
Do
{
Clear-Host
Write-Host -Object 'Please choose an option'
Write-Host -Object '**********************'
Write-Host -Object 'Scripts to run' -ForegroundColor Yellow
Write-Host -Object '**********************'
Write-Host -Object '1. Ping PC '
Write-Host -Object ""
Write-Host -Object '2. Restart ELP Desktops '
Write-Host -Object ''
Write-Host -Object '3. Restart NOVI Desktops '
Write-Host -Object ''
Write-Host -Object 'Q. Quit'
Write-Host -Object $errout
$Menu = Read-Host -Prompt '(0-3 or Q to Quit)'