When publishing a post, the Publish-MarkdownDriveImages modifies the content to replace the local images with their Google Drive urls. When authoring blog posts in tools like Obsidian, you would have a local image before publishing. However, after publishing, the markdown would be modified to point to URLs in Google Drive. This limits your ability to modify the local image and overwrite the image with a newer version.
Presently, Add-GoogleDriveFile supports overwriting existing files with newer versions when the -Force parameter is specified.
To retain the local image when publishing:
Update-MarkdownImages already supports an -OutFile parameter that if supplied writes the changes to a different file.
Publish-MarkdownDriveImages should include an -OutFile parameter which is passed to Update-MarkdownImages
Publish-MarkdownBloggerPost should include a -PreserveOriginal switch parameter, when specified should specify an temporary file for Publish-MarkdownDriveImages and use this temporary file with ConvertTo-HtmlFromMarkdown.
When publishing a post, the
Publish-MarkdownDriveImagesmodifies the content to replace the local images with their Google Drive urls. When authoring blog posts in tools like Obsidian, you would have a local image before publishing. However, after publishing, the markdown would be modified to point to URLs in Google Drive. This limits your ability to modify the local image and overwrite the image with a newer version.Presently,
Add-GoogleDriveFilesupports overwriting existing files with newer versions when the-Forceparameter is specified.To retain the local image when publishing:
Update-MarkdownImagesalready supports an-OutFileparameter that if supplied writes the changes to a different file.Publish-MarkdownDriveImagesshould include an-OutFileparameter which is passed toUpdate-MarkdownImagesPublish-MarkdownBloggerPostshould include a-PreserveOriginalswitch parameter, when specified should specify an temporary file forPublish-MarkdownDriveImagesand use this temporary file withConvertTo-HtmlFromMarkdown.