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

Added DSCConfigRoot env var in configs #313

Merged
merged 3 commits into from
Feb 10, 2024

Conversation

anmenaga
Copy link
Collaborator

@anmenaga anmenaga commented Feb 8, 2024

PR Summary

Fix #75

For config operations, if --path dsc parameter is used, then:

  1. DSCConfigRoot env var is defined and inherited by child resource processes that can be used to determine the location of the configuration file that is running;
  2. envvar function can be used in the configuration text like so:
resources:
- name: Class-resource Info
  type: PSTestModule/TestClassResource
  properties:
    Name: Instance1
    ResourcePath: "[envvar('DSCConfigRoot')]"

Notes:

  1. if configuration is piped using stdin or -d/--document parameter, then value of env var is empty string.
  2. for non-config operations env var is not created.

dsc/src/util.rs Outdated Show resolved Hide resolved
@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Feb 10, 2024
Merged via the queue into PowerShell:main with commit a7781cf Feb 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need a way to reference file paths relative to the config file
2 participants