You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Microsoft.Filesystem.File/Content currently fails when a file's parent path does not exist. This change makes the declarative ensure-present behavior create the required directory hierarchy automatically.
Create missing parent directories when _exist is true or omitted.
Keep _exist: false removal behavior unchanged and avoid adding an imperative force property.
Emit a localized DSC-compatible INFO message before directory creation and a specific error if creation fails.
Document the behavior and cover explicit and omitted _exist cases.
Tests: Focused FileContent set Pester tests (4 passed).
Changed code coverage measures only Rust lines added/modified in this PR.
Full codebase coverage measures all instrumented Rust lines across the project.
Validate parent path is a directory before writing
resources/filecontent/src/file.rs:43
Checking only exists() treats a regular file at the exact parent path as a valid parent. For a target such as <root>/blocked/file.txt where <root>/blocked is a file, this skips create_dir_all and falls through to the generic write error instead of the new parent-directory diagnostic. Check whether the parent is a directory so this conflict uses the intended creation failure path; the negative test should also exercise this exact-parent case.
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
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.
Microsoft.Filesystem.File/Contentcurrently fails when a file's parent path does not exist. This change makes the declarative ensure-present behavior create the required directory hierarchy automatically._exististrueor omitted._exist: falseremoval behavior unchanged and avoid adding an imperativeforceproperty._existcases.Tests: Focused FileContent set Pester tests (4 passed).
Fixes: #1728