Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Use of $env:COMSPEC may be invalid in some cases. #36

@u1f992

Description

@u1f992

In certain environments, this will be reproduced by running the installer as usual and launching Pico - Developer PowerShell.

Sorry for the Japanese UI, but it says "The expression after '&' in a pipeline element produced an object that was not valid. It must result in a command name, a script block, or a CommandInfo object."

image

This indicates that $env:COMSPEC is not defined. In fact, echo $env:COMSPEC did not print anything. Of course, I did not intentionally erase it... perhaps.

The disappearance seems to be a common occurrence, as evidenced by reports of similar problems occurring in other projects (other 3rd party applications supposedly erasing it? I have not investigated further).
ref: ScoopInstaller/Scoop#3845

Anyway, $env:COMSPEC is just an environment variable, and since it can disappear or contain strange things, some people think it is wise to specify cmd.exe directly if we obviously know we will use it.
ref: ScoopInstaller/Scoop#4692

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions