I have a few powershell Scripts (simple ones) I want to execute within Visual Studio Code.
When I run it with F5 the VSC turns orange (Debug Mode) for a few seconds and then turns back to normal without showing me anything.
This is the console output:
PS C:\Users\Huberdo\Documents\WindowsPowerShell> c:\Users\Huberdo\Documents\Meine Projekte\HD-Powershell-Scripts\Mailbox\HD-Mailbox.ps1
PS C:\Users\Huberdo\Documents\Meine Projekte\HD-Powershell-Scripts\Mailbox>
The Script should ask me to make a choice with Write-Host but it doesn't.
Here is the main script:
function Show-Menu() {
Write-Host "================ $Title ================"
Write-Host "1: Press '1' for this option."
Write-Host "2: Press '2' for this option."
Write-Host "3: Press '3' for this option."
Write-Host "Q: Press 'Q' to quit."
do {
Show-Menu
$input = Read-Host "Please make a selection"
switch ($input) {
'1' {
cls
'You chose option #1'
} '2' {
cls
'You chose option #2'
} '3' {
cls
'You chose option #3'
} 'q' {
return
}
}
pause
}
until ($input -eq 'q')
}
I have installed and activated the Powershell Extension. I googled and searched here on Stackoverflow for possible solutions or similiar questions, but couldn't find any.
Am I doing something wrong? I tried it with x86 and x64 PS.