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.