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

Add an Environment Variable 'refresh' before installing package #29

@gaelcolas

Description

@gaelcolas

Some packages, like RabbitMQ in the Chocolatey Repo, can have their installation customized based on Environment Variables (questionable but common method in *nix environment, and ported applications).

When using DSC and setting variables via the Environment resource (which, btw does not support [EnvironmentVariableTarget]), you'd need to restart before being able to install such package. Would it be possible to add a refresh Environment variable to the process that runs the install-package?

Would you consider a PR with the above?

Here's what the resulting configuration could look like:

        Environment RMQBase {
            Ensure            = 'Present'
            Name              = 'RABBITMQ_BASE'
            Value             = $Node.RabbitMQBase
        }

        Environment ErlangHome {
            Ensure            = 'Present'
            Name              = 'ERLANG_HOME'
            Value             = 'C:\Program Files\erl8.0'
        }

        PackageManagement RabbitMQ
        {
            Ensure            = 'present' 
            Name              = 'RabbitMQ'
            Source            = 'Chocolatey'
            DependsOn         = '[Environment]ErlangHome'
        }

The workarounds atm are: restarting, wait for next run, hack by killing session and restarting it, create custom PackageManagement resource to add the functionality...

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