windows_baseline.dsc.yaml is using deprecated Microsoft.DSC metadata

未關閉 適合新手
#1,831 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
1/5
預估耗時
1 小時以內
新手友好度
72/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
rust, yaml
領域
devops

研究方向

閱讀 configurations/windows/windows_baseline.dsc.yaml,並將其中繼資料與 issue #1369 中的棄用指引,以及 #1673 中提出的結構描述問題進行比較。執行 dsc config get --file windows_baseline.dsc.yaml 以確認警告,接著驗證更新後的範例在使用適當的結構描述和安全性內容時能無警告執行。

由索引模型根據 Issue 內容生成。

描述

Issue-Bug Need-Review
Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.
Summary

Usage of the Microsoft.DSC metadata has been deprecated after issue #1369.
The windows_baseline.dsc.yaml file still uses it, and issues a warning when run.
Provided samples shouldn't be using deprecated features.
Tested om 3.3.0 and 3.4.0-preview.3

https://github.com/PowerShell/DSC/blob/57d1ad87713cfc55883c0c7ecc38ad6f5aacb5cb/configurations/windows/windows_baseline.dsc.yaml#L1-L5

The fix is very easy, but I've not yet created a pull request, because I think it should be using a newer schema?
But issue #1673 complicates things/confuses me. Maybe I should just create a pull request and wait for the feedback.

# This configuration validates a Windows system against a security baseline configuration
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
directives:
  securityContext: elevated
Steps to reproduce
  1. run the following command:
dsc config get --file windows_baseline.dsc.yaml
Expected behavior
no warnings
Actual behavior
2026-11-26T03:07:03.201409Z  WARN Using 'Microsoft.DSC' metadata to specify required security context is deprecated. Please use the 'securityContext' directive in the configuration document instead.  See https://github.com/PowerShell/DSC/issues/1369 for more details.
Error details

Environment data
Name                           Value
----                           -----
PSVersion                      7.7.0
PSEdition                      Core
GitCommitId                    7.7.0
OS                             Microsoft Windows 10.0.26300
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.4
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Version

dsc 3.3.0

Visuals

No response

主要語言
Rust
星號
546
分支
84
平均合併
2 天 9 小時
30 天內合併 PR
25

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

PowerShell/DSC 的其他 Issue

查看 PowerShell/DSC 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。