diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeMinishell.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeMinishell.Tests.ps1 index 44db92b6ee..6cb14d9e78 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeMinishell.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeMinishell.Tests.ps1 @@ -10,9 +10,22 @@ Describe 'minishell for native executables' -Tag 'CI' { } It 'gets a hashtable object from minishell' { - $output = & powershell { @{'a' = 'b'} } + $output = & $powershell { @{'a' = 'b'} } ($output | measure).Count | Should Be 1 ($output.GetType().Name) | Should Be 'Hashtable' $output['a'] | Should Be 'b' } + + It 'gets the error stream from minishell' { + $output = & $powershell { Write-Error 'foo' } 2>&1 + ($output | measure).Count | Should Be 1 + ($output.GetType().Name) | Should Be 'ErrorRecord' + $output.FullyQualifiedErrorId | Should Be 'Microsoft.PowerShell.Commands.WriteErrorException' + } + + It 'gets the information stream from minishell' { + $output = & $powershell { Write-Information 'foo' } 6>&1 + ($output.GetType().Name) | Should Be 'InformationRecord' + $output | Should Be 'foo' + } }