Skip to content

Usage of ls and cat aliases #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gordonbondon opened this issue Jun 7, 2016 · 3 comments
Closed

Usage of ls and cat aliases #126

gordonbondon opened this issue Jun 7, 2016 · 3 comments
Assignees
Milestone

Comments

@gordonbondon
Copy link

There are a couple of places where ls is used instead of Get-ChildItem and cat instead of Get-Content which breaks New-ExternalHelp if you have this alias removed and use their git-bash counterparts in your environment.

ls:
https://github.com/PowerShell/platyPS/blob/master/src/platyPS/platyPS.psm1#L583
https://github.com/PowerShell/platyPS/blob/master/src/platyPS/platyPS.psm1#L854

cat:
https://github.com/PowerShell/platyPS/blob/master/src/platyPS/platyPS.psm1#L291
https://github.com/PowerShell/platyPS/blob/master/src/platyPS/platyPS.psm1#L365
https://github.com/PowerShell/platyPS/blob/master/src/platyPS/platyPS.psm1#L552

Output you get if this aliases are removed:

> New-ExternalHelp .\Docs -OutputPath .\en-US\
ls: unknown option -- e
Try '/usr/bin/ls --help' for more information.
> New-ExternalHelp .\Docs -OutputPath .\en-US\
cat: unknown option -- R
Try '/usr/bin/cat --help' for more information.
cat: unknown option -- R
Try '/usr/bin/cat --help' for more information.
cat: unknown option -- R
Try '/usr/bin/cat --help' for more information.
Get-MarkdownMetadata : Cannot bind argument to parameter 'Markdown' because it is an empty string.
At C:\Program Files\WindowsPowerShell\Modules\platyPS\0.4.0\platyPS.psm1:946 char:48
+     $metadata = Get-MarkdownMetadata -markdown $markdown
+                                                ~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-MarkdownMetadata], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Get-MarkdownMetadata

Exception calling "ParseString" with "2" argument(s): "Object reference not set to an instance of an object."
At C:\Program Files\WindowsPowerShell\Modules\platyPS\0.4.0\platyPS.psm1:898 char:9
+         $model = $p.ParseString($_, $parseMode)
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : NullReferenceException

Exception calling "NodeModelToMamlModel" with "1" argument(s): "Object reference not set to an instance of an
object."
At C:\Program Files\WindowsPowerShell\Modules\platyPS\0.4.0\platyPS.psm1:900 char:9
+         $maml = $t.NodeModelToMamlModel($model)
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : NullReferenceException

Exception calling "MamlModelToString" with "2" argument(s): "Object reference not set to an instance of an object."
At C:\Program Files\WindowsPowerShell\Modules\platyPS\0.4.0\platyPS.psm1:553 char:13
+             $xml = $r.MamlModelToString($maml, $false) # skipPreambul ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : NullReferenceException

MySetContent : Cannot bind argument to parameter 'value' because it is an empty string.
At C:\Program Files\WindowsPowerShell\Modules\platyPS\0.4.0\platyPS.psm1:556 char:48
+             MySetContent -Path $outPath -Value $xml -Encoding $Encodi ...
+                                                ~~~~
    + CategoryInfo          : InvalidData: (:) [MySetContent], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,MySetContent
@vors vors added the bug label Jun 8, 2016
@vors
Copy link
Collaborator

vors commented Jun 8, 2016

Thank you @gordonbondon !
My bad: I always use ls and cat and can hardly remeber what's the real cmdlet names for them.

I heard VSCode can take care of it and expend all aliases with a couple of keystrokes. Right @daviwil ?

@vors vors added this to the 0.5.0 milestone Jun 8, 2016
@vors vors self-assigned this Jun 8, 2016
@gordonbondon
Copy link
Author

@vors that shortcut should be Ctrl+Alt+e

@vors
Copy link
Collaborator

vors commented Jun 10, 2016

Fixed per b7fee27

@vors vors closed this as completed Jun 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants