PowerShell / DSC

This repo is for the DSC v3 project
MIT License
201 stars 29 forks source link

Added DSCConfigRoot env var in configs #313

Closed anmenaga closed 7 months ago

anmenaga commented 8 months ago

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.