PowerShell / platyPS

Write PowerShell External Help in Markdown
MIT License
765 stars 149 forks source link

Update-MarkdownHelpModule: Unable to write content because it is a directory #605

Closed Fred-Vatin closed 10 months ago

Fred-Vatin commented 11 months ago

Prerequisites

Steps to reproduce

PS OS PlatyPS
7.3.6 Win 10 x64 pro (french) 22H2 0.14.2

Steps to reproduce

My md files created with PlatyPS are in $OutputFolder = E:\OneDrive\Mes Documents\PowerShell\Modules\ModulesManager\1.0.0\PlatyTemplate

I want to update them using a ps script. Here is an excerpt.

Import-Module ModulesManager

$parameters = @{
    Path                  = "$OutputFolder"
    RefreshModulePage     = $true
    AlphabeticParamsOrder = $true
    UpdateInputOutput     = $false
    ExcludeDontShow       = $true
    LogPath               = "$OutputFolder"
    Force                 = $true
    LogAppend             = $true
    Encoding              = [System.Text.Encoding]::UTF8
}

Update-MarkdownHelpModule @parameters

Expected behavior

Updating files with no error.

Actual behavior

Getting unexpected errors.

Error details

Add-Content: Unable to write content because it is a directory: 'E:\OneDrive\Mes
Documents\PowerShell\Modules\ModulesManager\1.0.0\PlatyTemplate'.
Add-Content: Unable to write content because it is a directory: 'E:\OneDrive\Mes
Documents\PowerShell\Modules\ModulesManager\1.0.0\PlatyTemplate'.
Add-Content: Unable to write content because it is a directory: 'E:\OneDrive\Mes
Documents\PowerShell\Modules\ModulesManager\1.0.0\PlatyTemplate'.
Add-Content: Unable to write content because it is a directory: 'E:\OneDrive\Mes
Documents\PowerShell\Modules\ModulesManager\1.0.0\PlatyTemplate'.
Add-Content: Unable to write content because it is a directory: 'E:\OneDrive\Mes
Documents\PowerShell\Modules\ModulesManager\1.0.0\PlatyTemplate'.
Add-Content: Unable to write content because it is a directory: 'E:\OneDrive\Mes
Documents\PowerShell\Modules\ModulesManager\1.0.0\PlatyTemplate'.
Add-Content: Unable to write content because it is a directory: 'E:\OneDrive\Mes
Documents\PowerShell\Modules\ModulesManager\1.0.0\PlatyTemplate'.
Add-Content: Unable to write content because it is a directory: 'E:\OneDrive\Mes
Documents\PowerShell\Modules\ModulesManager\1.0.0\PlatyTemplate'.
Add-Content: Unable to write content because it is a directory: 'E:\OneDrive\Mes
Documents\PowerShell\Modules\ModulesManager\1.0.0\PlatyTemplate'.
Add-Content: Unable to write content because it is a directory: 'E:\OneDrive\Mes
Documents\PowerShell\Modules\ModulesManager\1.0.0\PlatyTemplate'.
Add-Content: Unable to write content because it is a directory: 'E:\OneDrive\Mes
Documents\PowerShell\Modules\ModulesManager\1.0.0\PlatyTemplate'.
Add-Content: Unable to write content because it is a directory: 'E:\OneDrive\Mes
Documents\PowerShell\Modules\ModulesManager\1.0.0\PlatyTemplate'.
Add-Content: Unable to write content because it is a directory: 'E:\OneDrive\Mes
Documents\PowerShell\Modules\ModulesManager\1.0.0\PlatyTemplate'.
Add-Content: Unable to write content because it is a directory: 'E:\OneDrive\Mes
Documents\PowerShell\Modules\ModulesManager\1.0.0\PlatyTemplate'.
Add-Content: Unable to write content because it is a directory: 'E:\OneDrive\Mes
Documents\PowerShell\Modules\ModulesManager\1.0.0\PlatyTemplate'.

Environment data

PSVersion                      7.3.6
PSEdition                      Core
GitCommitId                    7.3.6
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

image

sdwheeler commented 10 months ago

The LogPath parameter needs to be a full path to a file, not a folder. That is documented.

https://learn.microsoft.com/en-us/powershell/module/platyps/update-markdownhelpmodule?view=ps-modules#-logpath