Skip to content

Provide simple one-time setting of environment variable #3316

@lzybkr

Description

@lzybkr

Instructions for many tools from the Linux world suggest setting an environment variable for a single invocation of a command like:

JEKYLL_ENV=production jekyll build

The equivalent in PowerShell is cumbersome:

try {
    $oldValue = $env:JEKYLL_ENV
    $env:JEKYLL_ENV = "production"
    jekyll build
} finally {
    $env:JEKYLL_ENV = $oldValue
}

I believe a similar syntax could work in PowerShell:

$env:JEKYLL_ENV="production" jekyll build

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugKeepOpenThe bot will ignore these and not auto-closeWG-Languageparser, language semanticsWG-NeedsReviewNeeds a review by the labeled Working Group

    Type

    No type

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions