Skip to content

Enable deprecation of resources and extensions#1398

Merged
SteveL-MSFT merged 10 commits intoPowerShell:mainfrom
SteveL-MSFT:deprecate-psadapter
Feb 19, 2026
Merged

Enable deprecation of resources and extensions#1398
SteveL-MSFT merged 10 commits intoPowerShell:mainfrom
SteveL-MSFT:deprecate-psadapter

Conversation

@SteveL-MSFT
Copy link
Member

PR Summary

Add deprecationMessage optional field to resource, extension, and adapted resource manifests.

If this field exists, a warning message is emitted when the resource or extension is used (but not when discovered).

Microsoft.DSC/PowerShell and Microsoft.Windows/WindowsPowerShell manifests have been marked as deprecated pointing users to use the new adapters instead.

PR Context

Fix #1368

@SteveL-MSFT SteveL-MSFT added Doc-Impact Schema-Impact Change requires updating a canonical schema for configs or manifests labels Feb 19, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds deprecation support to DSC by introducing an optional deprecationMessage field to resource, extension, and adapted resource manifests. When this field is present, a warning message is displayed to users when the resource or extension is invoked. The PR also marks the legacy PowerShell adapters (Microsoft.DSC/PowerShell and Microsoft.Windows/WindowsPowerShell) as deprecated, directing users to use the newer Microsoft.Adapters/PowerShell and Microsoft.Adapters/WindowsPowerShell adapters instead.

Changes:

  • Added deprecationMessage optional field to resource, extension, and adapted resource manifest structures
  • Implemented warning emission logic across all resource and extension operations
  • Applied rename_all = "camelCase" serde attribute to manifest structs, eliminating manual field renaming
  • Marked old PowerShell adapters as deprecated with appropriate messages
  • Added comprehensive test coverage for deprecation warnings

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
lib/dsc-lib/src/dscresources/resource_manifest.rs Added deprecationMessage field to ResourceManifest with proper serialization attributes
lib/dsc-lib/src/extensions/extension_manifest.rs Added deprecationMessage field and applied rename_all camelCase attribute
lib/dsc-lib/src/dscresources/adapted_resource_manifest.rs Added deprecationMessage field to adapted resource manifests
lib/dsc-lib/src/dscresources/dscresource.rs Added deprecation warning emission to all resource operations (get, set, test, delete, validate, schema, export, resolve)
lib/dsc-lib/src/extensions/dscextension.rs Added deprecationMessage field to DscExtension output struct
lib/dsc-lib/src/extensions/discover.rs Added deprecation warning emission to discover operation
lib/dsc-lib/src/extensions/import.rs Added deprecation warning emission to import operation
lib/dsc-lib/src/extensions/secret.rs Added deprecation warning emission to secret operation
lib/dsc-lib/src/discovery/command_discovery.rs Updated manifest loading to include deprecation_message field
lib/dsc-lib/locales/en-us.toml Added localized deprecation warning messages for resources and extensions
adapters/powershell/powershell.dsc.resource.json Marked Microsoft.DSC/PowerShell adapter as deprecated
adapters/powershell/windowspowershell.dsc.resource.json Marked Microsoft.Windows/WindowsPowerShell adapter as deprecated
tools/dsctest/src/main.rs Added NoOp subcommand for testing
tools/dsctest/src/args.rs Added NoOp subcommand definition
tools/dsctest/src/adapter.rs Added Adapted/Deprecated test resource
tools/dsctest/dsctest.dsc.manifests.json Added test manifests for deprecated resources and extensions
tools/test_group_resource/src/main.rs Updated to include deprecation_message field (set to None)
dsc/tests/dsc_resource_deprecated.tests.ps1 New comprehensive test suite for deprecated resources
dsc/tests/dsc_extension_secret.tests.ps1 Added test for deprecated extension warning in secret operations
dsc/tests/dsc_extension_import.tests.ps1 New test file for deprecated extension import behavior
dsc/tests/dsc_extension_discover.tests.ps1 Added tests for deprecated extension discovery behavior
dsc/tests/dsc_adapter.tests.ps1 Added test for deprecated adapted resource warnings
adapters/powershell/Tests/win_powershellgroup.tests.ps1 Added deprecation warning verification for WindowsPowerShell adapter
adapters/powershell/Tests/powershellgroup.config.tests.ps1 Added deprecation warning verification for PowerShell adapter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

SteveL-MSFT and others added 9 commits February 18, 2026 17:02
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Feb 19, 2026
Merged via the queue into PowerShell:main with commit 4ec26df Feb 19, 2026
19 checks passed
@SteveL-MSFT SteveL-MSFT deleted the deprecate-psadapter branch February 19, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Doc-Impact Schema-Impact Change requires updating a canonical schema for configs or manifests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mark the old Microsoft.DSC/PowerShell and Microsoft.Windows/WindowsPowerShell adapters as deprecated

2 participants

Comments