Consider the script "test.ps1:
Get-EventLog -list | gm
When it is called from the Powershell console (".\test.ps1"), it outputs the members as expected.
However, the following scripts don't show the output from "Get-EventLog -list | gm":
Script 1
Get-EventLog -list | gm
break
Script 2
Get-EventLog -list | gm
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", "Continua execucao"
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", "Cancela operacao"
$options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)
$result = $host.ui.PromptForChoice("Title", "Message", $options, 0)
If I change "Get-EventLog -list | gm" to a text like "Hello World", it is correctly displayed, in both cases.
Why is the output from the cmdlet not shown?
Get-EventLog -list | gm | out-host
– CB.