In a powershell script file.ps1, I have
Write-Host "here is a host message"
Write-Verbose "here is a verbose message"
When file.ps1 is run in Windows Terminal using Powershell 7, not all messages are written to the console.
PS> .\file.ps1
here is a host message
I would like to be able to pass -Verbose so Write-Verbose is seen:
PS> .\file.ps1 -Verbose
here is a host message
here is a verbose message
What does script file.ps1 need to enable verbose messages?