Skip to content

Add --ignore-settings-file and DSC_IGNORE_SETTINGS_FILE env var#1628

Merged
SteveL-MSFT merged 1 commit into
PowerShell:mainfrom
SteveL-MSFT:ignore-settings
Jul 15, 2026
Merged

Add --ignore-settings-file and DSC_IGNORE_SETTINGS_FILE env var#1628
SteveL-MSFT merged 1 commit into
PowerShell:mainfrom
SteveL-MSFT:ignore-settings

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

PR Summary

Partner has a need to ignore the settings file. Added --ignore-settings-file switch but can also set DSC_IGNORE_SETTINGS_FILE env var (just has to exist, value doesn't matter) for the same purpose. We can consider adding a setting to the file to now allow this switch should that need arise.

The implementation simply sets the env var if the switch is used.

Copilot AI review requested due to automatic review settings July 14, 2026 22:49
@SteveL-MSFT SteveL-MSFT added this to the 3.2-Consider milestone Jul 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new way to bypass DSC settings-file processing by introducing a --ignore-settings-file CLI switch and a DSC_IGNORE_SETTINGS_FILE environment variable, primarily to support partner scenarios where settings-file behavior must be suppressed.

Changes:

  • Introduces --ignore-settings-file (and wires it to set DSC_IGNORE_SETTINGS_FILE) to disable settings-file usage.
  • Updates dsc-lib settings resolution to short-circuit when the env var is present and emits a warning.
  • Adds Pester coverage validating both the env var and CLI flag behaviors, plus localized help/warning strings.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lib/dsc-lib/src/util.rs Adds env var gate to skip settings lookup and warn.
lib/dsc-lib/locales/en-us.toml Adds localized warning text for ignoring the settings file.
dsc/tests/dsc_settings.tests.ps1 Adds tests for env var and CLI flag behavior.
dsc/src/main.rs Sets DSC_IGNORE_SETTINGS_FILE when --ignore-settings-file is used.
dsc/src/args.rs Adds --ignore-settings-file argument definition.
dsc/locales/en-us.toml Adds localized help text for the new CLI flag.

Comment thread lib/dsc-lib/src/util.rs
Comment thread dsc/src/args.rs
Comment thread dsc/tests/dsc_settings.tests.ps1
@SteveL-MSFT
SteveL-MSFT added this pull request to the merge queue Jul 15, 2026
Merged via the queue into PowerShell:main with commit 9da1166 Jul 15, 2026
20 checks passed
@SteveL-MSFT
SteveL-MSFT deleted the ignore-settings branch July 15, 2026 18:06
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.

3 participants