1

I started using GitShell on my Windows 7 computer in order to try to get a script to work properly. When I type ls into the shell, it works fine and displays the file. When I type ls -a, or ls -la it gives me this error -

Get-ChildItem : A parameter cannot be found that matches parameter name 'a'.
At line:1 char:6
+ ls -a <<<<
+ CategoryInfo          : InvalidArgument: (:) [Get-ChildItem], ParameterB
indingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Comm
ands.GetChildItemCommand

My co-worker is using the commands on her identical computer just fine. What could the problem be?

Kev
  • 118,037
  • 53
  • 300
  • 385
J. Doe
  • 1,479
  • 5
  • 25
  • 49

2 Answers2

3

This is because you're typing commands into PowerShell not GitShell.

PowerShell does have a ls command but it's an alias of Get-ChildItem which doesn't have the same switches as the ls command as found in unix shells.

Kev
  • 118,037
  • 53
  • 300
  • 385
  • Ah ok. I downloade Git Bash instead based on what you said and it works properly now. Thanks for the pointer in the right direction! – J. Doe Aug 17 '15 at 14:20
  • 1
    @KyleVassella you should ask this as a new question though this might help: https://superuser.com/questions/364083/windows-list-files-and-their-permissions-access-in-command-line - be aware that due to differences in the way that Windows and Linux handle permissions and ACL's you're probably not going to get an exactly analogous way of doing this. – Kev Apr 12 '17 at 09:28
1

If you can use the GitHub gui client for a moment, then start it. Then open the "Options..." (under the little gear icon). Then where it has "Default Shell" choose "Git Bash" instead of "PowerShell".

Once you do that, then you can open the Git Shell, and it will open the bash shell instead, and you will then be able to use ls -al and all the other commands that powershell doesn't do right.