Import-MarkdownCommandHelp does not resolve paths correctly in Windows PowerShell
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start with the Import-MarkdownCommandHelp entry point and reproduce the pipeline behavior in Windows PowerShell 5.1 and PowerShell 7 using the commands and paths shown. Trace how pipeline input is resolved and compare the resulting paths between versions. Done means the Windows PowerShell invocation resolves the supplied Markdown files instead of searching the current directory.
Written by the indexing model from the issue text.
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest version
- Search the existing issues.
Steps to reproduce
In Windows PowerShell if I try to import markdown files from the pipeline I experience this:
PS C:\Windows\system32> ls 'C:\Users\Martin\source\repos\MouseSettings\Docs' -Recurse -Filter *.md | Import-MarkdownCommandHelp
Import-MarkdownCommandHelp : Cannot find path 'C:\Windows\system32\Get-MouseSettings.md' because it does not exist.
At line:1 char:78
+ ... ouseSettings\Docs' -Recurse -Filter *.md | Import-MarkdownCommandHelp
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.String[]:String[]) [Import-MarkdownCommandHelp], ItemNotFoundException
+ FullyQualifiedErrorId : Could not resolve Path,Microsoft.PowerShell.PlatyPS.ImportMarkdownHelpCommand
Import-MarkdownCommandHelp : Cannot find path 'C:\Windows\system32\Set-MouseSettings.md' because it does not exist.
At line:1 char:78
+ ... ouseSettings\Docs' -Recurse -Filter *.md | Import-MarkdownCommandHelp
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.String[]:String[]) [Import-MarkdownCommandHelp], ItemNotFoundException
+ FullyQualifiedErrorId : Could not resolve Path,Microsoft.PowerShell.PlatyPS.ImportMarkdownHelpCommand
PS C:\Windows\system32>
Note how it tries to find the file names in the current directory. If I do the same from PowerShell 7 it works perfectly fine:
PS C:\Windows\System32> ls 'C:\Users\Martin\source\repos\MouseSettings\Docs' -Recurse -Filter *.md | Import-MarkdownCommandHelp
Title ModuleName Synopsis
----- ---------- --------
Get-MouseSettings MouseSettings Gets all the current mouse settings that this module can manage.
Set-MouseSettings MouseSettings Sets various mouse settings.
PS C:\Windows\System32>
Expected behavior
It finds the files from pipeline input like so:
PS C:\Windows\System32> ls 'C:\Users\Martin\source\repos\MouseSettings\Docs' -Recurse -Filter *.md | Import-MarkdownCommandHelp
Title ModuleName Synopsis
----- ---------- --------
Get-MouseSettings MouseSettings Gets all the current mouse settings that this module can manage.
Set-MouseSettings MouseSettings Sets various mouse settings.
Actual behavior
It throws an error because it's trying to find files in the wrong directory:
PS C:\Windows\system32> ls 'C:\Users\Martin\source\repos\MouseSettings\Docs' -Recurse -Filter *.md | Import-MarkdownCommandHelp
Import-MarkdownCommandHelp : Cannot find path 'C:\Windows\system32\Get-MouseSettings.md' because it does not exist.
At line:1 char:78
+ ... ouseSettings\Docs' -Recurse -Filter *.md | Import-MarkdownCommandHelp
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.String[]:String[]) [Import-MarkdownCommandHelp], ItemNotFoundException
+ FullyQualifiedErrorId : Could not resolve Path,Microsoft.PowerShell.PlatyPS.ImportMarkdownHelpCommand
Import-MarkdownCommandHelp : Cannot find path 'C:\Windows\system32\Set-MouseSettings.md' because it does not exist.
At line:1 char:78
+ ... ouseSettings\Docs' -Recurse -Filter *.md | Import-MarkdownCommandHelp
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.String[]:String[]) [Import-MarkdownCommandHelp], ItemNotFoundException
+ FullyQualifiedErrorId : Could not resolve Path,Microsoft.PowerShell.PlatyPS.ImportMarkdownHelpCommand
PS C:\Windows\system32>
Error details
Environment data
Name Value
---- -----
PSVersion 5.1.26100.7920
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.26100.7920
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Version
1.0.1
Visuals
No response
- Dominant language
- C#
- Stars
- 870
- Forks
- 166
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PowerShell/platyPS
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
PowerShell/platyPS#868 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PowerShell/platyPS#857 ·
-
Difficulty 3/5 Half a day Newbie friendliness 68/100
PowerShell/platyPS#867 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
PowerShell/platyPS#863 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
PowerShell/platyPS#862 ·
All issues in PowerShell/platyPS
Similar issues
-
status:waiting-for-triage type:bug
Difficulty 1/5 Under an hour Newbie friendliness 84/100
microsoftgraph/msgraph-sdk-dotnet#3194 ·
Maintainers usually reply within 1 day
-
Backend enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
UI: money shows the minus sign next to the number, not before the currency (IL -3.0m, not -IL 3.0m)Openarea: sim area: unity enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eyalgolan/statecraft-israel#1107 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
dimitar-radenkov/Pointframe#271 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
qew21/Genshin-Subtitles#45 ·