Skip to content

Add-Content -Force doesn't create missing intermediate directories while docs say that it does #8299

@kganjam

Description

@kganjam

Docs:

-Force
Overrides the read-only attribute, allowing you to add content to a read-only file. For example, Force will override the read-only attribute or create directories to complete a file path, but it will not attempt to change file permissions.

See the stack overflow post for a repro:

https://stackoverflow.com/questions/48425562/powershell-add-content-should-create-path-but-throws-exception-could-not-find-a


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

Labels

area-managementArea - Microsoft.PowerShell.Management module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions