PowerShell / DSC

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

Updates to DSC_CONFIG_ROOT env var #342

Closed anmenaga closed 7 months ago

anmenaga commented 7 months ago

PR Summary

Fix #317 , #335

PR Context

Updates:

  1. Renamed env var to be DSC_CONFIG_ROOT
  2. Added a warning if DSC_CONFIG_ROOT env var already exists by the time it is overwritten by dsc.exe
  3. Path in DSC_CONFIG_ROOT env var is now always absolutized
  4. The dsc.exe --path parameter value is now always absolutized

Before change:

PS C:\DSCv3> dsc -l debug config get --path .\..\D1/test_config.dsc.yaml
2024-03-04T20:46:30.706571Z DEBUG dsc: 36: Running dsc 3.0.0-alpha.6
2024-03-04T20:46:30.706935Z DEBUG dsc::util: 419: Setting 'DSCConfigRoot' env var as '.\..\D1'
2024-03-04T20:46:30.707272Z DEBUG dsc::util: 379: Reading input from file .\..\D1/test_config.dsc.yaml

After change:

PS C:\DSCv3> dsc -l debug config get --path .\..\D1/test_config.dsc.yaml
2024-03-04T20:35:11.929049Z DEBUG dsc: 36: Running dsc 3.0.0-alpha.6
2024-03-04T20:35:11.929408Z DEBUG dsc::util: 436: Setting 'DSC_CONFIG_ROOT' env var as 'C:\D1'
2024-03-04T20:35:11.929742Z DEBUG dsc::util: 380: Reading input from file C:\D1\test_config.dsc.yaml