Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Out-Default doesn't work and messages to host are buffered? #4628

Closed
ryhayash opened this issue Aug 21, 2017 · 2 comments
Closed

Internal Out-Default doesn't work and messages to host are buffered? #4628

ryhayash opened this issue Aug 21, 2017 · 2 comments
Labels
Resolution-Duplicate The issue is a duplicate.

Comments

@ryhayash
Copy link

Steps to reproduce

PowerShell console messages are not displayed with correct order. This issue happens with a lot of cmdlets but some cmdlets(ex get-process/get-service) work well. For example, run the following script. You can see the messages shown with wrong order. I know 'Out-Default' is called internally from most of get-xxx cmdlets but it looks like it does't work in some cases. I think console messages should be displayed sequentially with correct order because 'Out-Default' is called internally. But actual behavior is not(Out-Default is called but the message is buffered and not displayed). So please check if this is a bug or by design with host message buffering.

Write-Output "Before get-acl"
get-acl 
Write-Output "After get-acl"
Read-host "Enter something"

Expected behavior

The output messages are displayed in powershell console/ISE with the following order.

Before get-acl

    ディレクトリ: C:\WINDOWS

Path     Owner                       Access                                                                                                      
----     -----                       ------                                                                                                      
system32 NT SERVICE\TrustedInstaller CREATOR OWNER Allow  268435456...                                                                           

After get-acl
Enter something: 

Actual behavior

The powershell console/ISE shows the messages in wrong order like this. The output of get-acl is buffered and not displayed and message of Read-Host appears prior to output of get-acl.

Before get-acl

Enter something:   <---- Should be displayed after output of get-acl

    ディレクトリ: C:\WINDOWS

Path     Owner                       Access                                                                                                      
----     -----                       ------                                                                                                      
system32 NT SERVICE\TrustedInstaller CREATOR OWNER Allow  268435456...                                                                           
After get-acl

Environment data

PS C:\WINDOWS\system32> $PSVersionTable


Name                           Value                                                                                                             
----                           -----                                                                                                             
PSVersion                      5.1.14393.1532                                                                                                    
PSEdition                      Desktop                                                                                                           
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                           
BuildVersion                   10.0.14393.1532                                                                                                   
CLRVersion                     4.0.30319.42000                                                                                                   
WSManStackVersion              3.0                                                                                                               
PSRemotingProtocolVersion      2.3                                                                                                               
SerializationVersion           1.1.0.1                                                                                                           

@mklement0
Copy link
Contributor

Please see #4594.

@iSazonov iSazonov added the Resolution-Duplicate The issue is a duplicate. label Aug 21, 2017
@iSazonov
Copy link
Collaborator

Closed as dup #4594.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate The issue is a duplicate.
Projects
None yet
Development

No branches or pull requests

3 participants