-
Notifications
You must be signed in to change notification settings - Fork 57
Enable deprecation of resources and extensions #1398
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
Merged
SteveL-MSFT
merged 10 commits into
PowerShell:main
from
SteveL-MSFT:deprecate-psadapter
Feb 19, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d717f6b
Enable deprecation of resources and extensions
SteveL-MSFT 72c5443
Update adapters/powershell/Tests/win_powershellgroup.tests.ps1
SteveL-MSFT 603c0c0
Update dsc/tests/dsc_extension_import.tests.ps1
SteveL-MSFT fe93aee
Update dsc/tests/dsc_extension_discover.tests.ps1
SteveL-MSFT 0a2ea7a
Update lib/dsc-lib/src/extensions/extension_manifest.rs
SteveL-MSFT 439d824
Update lib/dsc-lib/src/extensions/extension_manifest.rs
SteveL-MSFT 4f317fb
Update lib/dsc-lib/src/dscresources/adapted_resource_manifest.rs
SteveL-MSFT 36f3069
fix test
SteveL-MSFT cd53402
Merge branch 'deprecate-psadapter' of github.com:SteveL-MSFT/DSC into…
SteveL-MSFT 9fd644f
put deprecated resources under subfolder
SteveL-MSFT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # Licensed under the MIT License. | ||
|
|
||
| Describe 'Import extension tests' { | ||
| It 'Deprecated extension shows message' { | ||
| try { | ||
| $dscHome = Split-Path (Get-Command dsc).Source -Parent | ||
| $env:DSC_RESOURCE_PATH = (Join-Path -Path $dscHome -ChildPath 'deprecated') + [System.IO.Path]::PathSeparator + $dscHome | ||
|
|
||
| Set-Content -Path "$TestDrive/test.testimport" -Value 'Test content' | ||
| $null = dsc config get -f "$TestDrive/test.testimport" 2> $TestDrive/error.log | ConvertFrom-Json | ||
| $LASTEXITCODE | Should -Be 2 -Because (Get-Content -Path "$TestDrive/error.log" -Raw | Out-String) | ||
| (Get-Content -Path "$TestDrive/error.log" -Raw) | Should -Match "Extension 'Test/ExtensionDeprecated' is deprecated: This extension is deprecated" -Because (Get-Content -Path "$TestDrive/error.log" -Raw | Out-String) | ||
| } finally { | ||
| $env:DSC_RESOURCE_PATH = $null | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # Licensed under the MIT License. | ||
|
|
||
| Describe 'Deprecated resource tests' { | ||
| BeforeAll { | ||
| $dscHome = Split-Path (Get-Command dsc).Source -Parent | ||
| $env:DSC_RESOURCE_PATH = (Join-Path -Path $dscHome -ChildPath 'deprecated') + [System.IO.Path]::PathSeparator + $dscHome | ||
| } | ||
|
|
||
| AfterAll { | ||
| $env:DSC_RESOURCE_PATH = $null | ||
| } | ||
|
|
||
| It 'Deprecated resource for operation <operation>' -TestCases @( | ||
| @{ operation = 'get' } | ||
| @{ operation = 'set' } | ||
| @{ operation = 'delete' } | ||
| @{ operation = 'test' } | ||
| @{ operation = 'export' } | ||
| ) { | ||
| param($operation) | ||
|
|
||
| $out = dsc resource $operation -r Test/OperationDeprecated -i '{}' 2>$TestDrive/error.log | ConvertFrom-Json | ||
| $LASTEXITCODE | Should -Be 0 -Because (Get-Content $TestDrive/error.log -Raw | Out-String) | ||
| if ($operation -eq 'delete') { | ||
| $out | Should -BeNullOrEmpty | ||
| } else { | ||
| $out | Should -Not -BeNullOrEmpty | ||
| } | ||
| (Get-Content $TestDrive/error.log -Raw) | Should -Match "Resource 'Test/OperationDeprecated' is deprecated: This resource is deprecated" | ||
| } | ||
|
|
||
| It 'Deprecated resource for schema' { | ||
| $out = dsc resource schema -r Test/OperationDeprecated 2>$TestDrive/error.log | ConvertFrom-Json | ||
| $LASTEXITCODE | Should -Be 0 -Because (Get-Content $TestDrive/error.log -Raw | Out-String) | ||
| $out | Should -Not -BeNullOrEmpty | ||
| (Get-Content $TestDrive/error.log -Raw) | Should -Match "Resource 'Test/OperationDeprecated' is deprecated: This resource is deprecated" | ||
| } | ||
|
|
||
| It 'Deprecated message when used in config' { | ||
| $configYaml = @' | ||
| $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json | ||
| resources: | ||
| - name: test | ||
| type: Test/OperationDeprecated | ||
| properties: | ||
| operation: get | ||
| '@ | ||
|
|
||
| $out = dsc config get -i $configYaml 2>$TestDrive/error.log | ConvertFrom-Json | ||
| $LASTEXITCODE | Should -Be 0 -Because (Get-Content $TestDrive/error.log -Raw | Out-String) | ||
| $out.results.count | Should -Be 1 | ||
| $out.results[0].type | Should -BeExactly 'Test/OperationDeprecated' | ||
| (Get-Content $TestDrive/error.log -Raw) | Should -Match "Resource 'Test/OperationDeprecated' is deprecated: This resource is deprecated" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.