I'm currently running Gentoo Linux and have installed PowerShell (app-shells/pwsh-bin) as I am a contrarian.
That being said, I am unable to obtain colour by default when running certain commands. Take ls
or grep
. When running ls
or grep
in a normal shell (e.g. bash) I will get colourful output by default. When running ls
or grep
in PowerShell, I must manually call these two commands with ls --color
or grep --color
to obtain colour. That being said, commands such as emerge
do have colour by default in PowerShell (though emerge doesn't work, which is another issue).
I was wondering what I have to do to ensure that these commands have colour. Perhaps PowerShell doesn't use the default utilities and defines ls
as an alias for its own command. I don't know how to use this information to solve my problem, though.
edit: The provided answer does not really solve my problem. While I now have colour when running ls
, I do not have colour when running grep
. Additionally, I get plenty of errors with the provided profile along the lines of:
Set-Alias: /home/jj/.config/powershell/Microsoft.PowerShell_profile.ps1:2 Line | 2 | set-alias cd set-location | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | The AllScope option cannot be removed from the alias 'cd'.