'man' should be removed as an alias on Windows installations
See original GitHub issueSummary of the new feature / enhancement
The man
alias on Windows is not needed and adds confusion when using PowerShell with multiple operating systems.
On Windows
PS> get-command man
CommandType Name Version Source
----------- ---- ------- ------
Alias man -> help
On Linux
PS> get-command man
CommandType Name Version Source
----------- ---- ------- ------
Application man 0.0.0.0 /usr/bin/man
So depending on the system you are using they return completely different information.
On Linux
PS> man pwsh
PWSH(1) PWSH(1)
NAME
pwsh - PowerShell command-line shell and .NET REPL
SYNOPSIS
pwsh [-NoLogo] [-NoExit] [-NoProfile] [-NonInteractive] [-InputFormat {Text | XML}] [-OutputFormat {Text |
XML}] [-EncodedCommand Base64EncodedCommand] [-File filePath args] [-ExecutionPolicy ExecutionPolicy] [-Com‐
mand { - | script-block [-args arg-array] | string [CommandParameters] } ]
DESCRIPTION
PowerShell is an automation and configuration management platform. It consists of a cross-platform (Windows,
Linux and macOS) command-line shell and associated scripting language.
But on Windows,
PS> man pwsh
Get-Help:
Line |
64 | $help = Get-Help @PSBoundParameters
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Get-Help could not find pwsh in a help file in this session. To download updated help topics type: "Update-Help". To get help online, search for the help topic in the TechNet library at https://go.microsoft.com/fwlink/?LinkID=107116.
man
as a command has no historical lineage on Windows except for with Unix/shell emulators. help
does, and even existed in MSDOS commmand.com
.
Having man
as an alias does not “make PowerShell like bash” because it returns completely different information.
Proposed technical implementation details (optional)
Remove the ‘man’ alias on windows installations.
Issue Analytics
- State:
- Created 4 months ago
- Reactions:1
- Comments:20 (8 by maintainers)
Top Results From Across the Web
'man' should be removed as an alias on Windows ...
'man' should be removed as an alias on Windows installations #17342. Sign in to view logs · Sign in to view logs. Summary....
Read more >Closing account to use email as alias?
First, any email addresses included in a post are removed for security reasons so no one can see what has been entered which...
Read more >So is the alias feature locked behind a paid version now?
I've always been able to set aliases on my computers and today I did a fresh windows install and now the alias button...
Read more >Python was not found; run without arguments to install from ...
Check your Python version and be sure it is installed on your machine ... Go to -> "start" and type "Manage App Execution...
Read more >Removing the PowerShell curl alias? - Daniel Stenberg - Haxx
We added a number of aliases for Unix commands but if someone has installed those commands on WIndows, those aliases screw them up....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Pragmatically speaking, you can put the following in your
$PROFILE
to also get Unixman
behavior on Windows - assuming WSL is installed:I was never a fan of aliases named for other platforms’ utilities / other shells’ built-in commands, but to me the only compelling reason to take an existing alias away is if it shadows a standard utility on a given platform - and even that can be problematic, especially if no PowerShell-native alternative exists (for an infamous case where that happened, see the
sc
/sc.exe
fiasco; I advocated for removal at the time, which I regret in hindsight, given thatSet-Content
now has no built-in alias)While I understand the cross-platform argument, it’s important to note that there are plenty of Windows-only users, and the potential confusion doesn’t apply to them; they may have come to value this alias (and @kborowinski seems to value it even as a cross-platform user).
Note that
man
is only one of quite a few aliases that are Windows-only:Output:
This discussion has been useful.