Add Microsoft/FileContent resource - #1676
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new cross-platform DSC resource (Microsoft/FileContent) implemented in Rust to manage UTF-8 file content via set, verify integrity via get/test hash outputs, and emit full content only via export. This extends the resource catalog and updates packaging/build inputs so the new resource ships across Linux/macOS/Windows.
Changes:
- Introduces the
filecontentRust resource executable withget/set/test/exportoperations, i18n strings, and a v3 resource manifest/schema. - Adds cross-platform Pester coverage for
get/set/test/exportand delete (_exist: false) behavior. - Registers the new resource in the workspace/build metadata and package payload lists.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/filecontent/src/main.rs | Resource CLI entrypoint and JSON input parsing for operations. |
| resources/filecontent/src/file.rs | Core file I/O + hashing logic for get/set/test/export. |
| resources/filecontent/src/types.rs | Input/output DTOs for resource operations. |
| resources/filecontent/locales/en-us.toml | Localized user-facing strings via rust-i18n. |
| resources/filecontent/filecontent.dsc.resource.json | Resource manifest + embedded JSON schema for Microsoft/FileContent. |
| resources/filecontent/Cargo.toml | New resource crate definition and dependencies. |
| resources/filecontent/.project.data.json | Build metadata for including the resource binary + manifest. |
| resources/filecontent/tests/filecontent_get.tests.ps1 | Pester tests validating get hashes and no content leakage. |
| resources/filecontent/tests/filecontent_set.tests.ps1 | Pester tests validating set writes and _exist: false deletion. |
| resources/filecontent/tests/filecontent_test.tests.ps1 | Pester tests validating test hash-based desired state evaluation. |
| resources/filecontent/tests/filecontent_export.tests.ps1 | Pester tests validating export returns content + hashes. |
| data.build.json | Adds the new resource artifacts to platform payload lists and project catalog. |
| Cargo.toml | Adds the new resource crate to workspace members/default members and introduces sha2 workspace dep. |
| Cargo.lock | Records the new filecontent package and dependency linkage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
😐 Code Coverage ReportChanged Code Coverage75% (70%+ coverage)
🔵 Full Codebase Coverage82% (good)
|
Adds a cross-platform DSC resource for managing UTF-8 file content and verifying file integrity without exposing content from normal get operations.
Summary
Microsoft/FileContentin Rust with get, set, explicit test, and export operations._exist: false.Testing