Microsoft.Filesystem.File/Content - Froce tor create path if don't exist
还没有人认领这个 Issue。
评估
调研方向
Start with the Microsoft.Filesystem.File/Content resource and reproduce the YAML configuration using a nested, nonexistent Windows path such as C:\dsc\config\file-content\New\TestFile.txt. Read the resource behavior around file creation and the reported “path specified” error, then verify that the selected force behavior creates the directories and file successfully.
由索引模型根据 Issue 内容生成。
描述
Summary of the new feature / enhancement
Hi team,
Is a possibility to create whole folder path and structure when file shoudl be located in dedicated folder, smililar like in PowerShell with --force swith when we create New-Item, I see scenarios whe this will be reguired before servers or application be install or created
Example of config
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
- name: Test File
type: Microsoft.Filesystem.File/Content
properties:
_exist: true # This will work as force
path: C:\dsc\config\file-content\New\TestFile.txt
content: "This is a test file."
or option B
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
- name: Test File
type: Microsoft.Filesystem.File/Content
properties:
force: true # Creation file and path
path: C:\dsc\config\file-content\New\TestFile.txt
content: "This is a test file."
Proposed technical implementation details (optional)
Now when I try to create file in path that don't exist as Subfolder I got error"
ontent' using 'filecontent'
2026-09-20T18:58:38.517129Z DEBUG dsc_lib::dscresources::command_resource: 912: Process 'filecontent' id 6008 exited with code 0
2026-09-20T18:58:38.537890Z DEBUG dsc_lib::dscresources::command_resource: 196: Verifying output of get on 'Microsoft.Filesystem.File/Content' using 'filecontent'
2026-09-20T18:58:38.538332Z DEBUG dsc_lib::dscresources::command_resource: 586: Retrieved schema for resource 'Microsoft.Filesystem.File/Content' with version '0.1.0' from cache
2026-09-20T18:58:38.618624Z ERROR dsc_lib::dscresources::command_resource: 1313: PID 9064: Failed to write file 'C:\dsc\config\file-content\New\TestFile.txt': The system cannot find the path specified. (os error 3)
2026-09-20T18:58:38.619190Z DEBUG dsc_lib::dscresources::command_resource: 912: Process 'filecontent' id 9064 exited with code 3
2026-09-20T18:58:38.619546Z ERROR dsc_lib::dscresources::command_resource: 970: Failed to run process 'filecontent': Command: Resource 'filecontent' [exit code 3] manifest description: File operation error
2026-09-20T18:58:38.620590Z ERROR dsc::subcommand: 108: Error: Command: Resource 'filecontent' [exit code 3] manifest description: File operation error
PS C:\dsc\config\file-content>
- 主要语言
- Rust
- 星标
- 526
- 派生
- 76
- 平均合并
- 4 天 22 小时
- 30 天内合并 PR
- 25
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PowerShell/DSC 的其他 Issue
-
Issue-Enhancement Needs Triage
难度 3/5 1-2 天 新手友好度 55/100
PowerShell/DSC#1731 ·
-
Issue-Enhancement Needs Triage
难度 5/5 一周以上 新手友好度 38/100
PowerShell/DSC#1729 ·
-
Issue-Bug Need-Review
难度 3/5 1-2 天 新手友好度 55/100
PowerShell/DSC#1727 · 4 条评论 ·
-
Issue-Enhancement
难度 4/5 3-5 天 新手友好度 62/100
PowerShell/DSC#1722 · 3 条评论 ·
-
Dev-UX Needs Triage
难度 5/5 一周以上 新手友好度 35/100
PowerShell/DSC#1694 ·
相似的 Issue
-
bug github_actions
难度 2/5 1-3 小时 新手友好度 75/100
registrystack/registry-stack#1393 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
longbridge/gpui-kit#3223 ·
-
bug engine
难度 2/5 1-3 小时 新手友好度 65/100
rocky-data/rocky#2181 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
oasisprotocol/oasis-sdk#2523 ·
-
bot:ai-assisted component:indexer QA-roadmap status:untriaged
难度 2/5 1-3 小时 新手友好度 75/100
midnightntwrk/midnight-indexer#1557 ·