Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Windows: Only the pipeline operator (|) makes invocation of a GUI application synchronous, not also the redirection operator (>) #26455

Open
Labels
Needs-TriageThe issue is new and needs to be triaged by a work group.
@mklement0

Description

@mklement0

Prerequisites

Steps to reproduce

Note: This is an edge case; if correcting the inconsistency discussed below is deemed not worth the effort, it should at least be documented.

  • On Windows, GUI-subsystem applications execute asynchronously by default.
  • Piping (|) them to another command makes the call synchronous and also populates$LASTEXITCODE
  • By contrast, applying aredirection (>) surprisingly doesnot do that.

The piping technique is a useful (albeit obscure) shortcut to invoking GUI applications synchronously (albeit limited to GUI applications that do not delegate to another process on startup);>$null would make it more concise.

msiexec.exe|Out-Null"`$LASTEXITCODE after:$LASTEXITCODE"$global:LASTEXITCODE=0msiexec.exe>$null"`$LASTEXITCODE after:$LASTEXITCODE"

Expected behavior

Both invocations ofmsiexec.exe should be synchronous (blocking) and populate$LASTEXITCODE

Actual behavior

Only the first invocation behaves as expected.

Error details

Environment data

PowerShell7.6.0-preview.5 on Windows.

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-TriageThe issue is new and needs to be triaged by a work group.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp