Last active
November 23, 2016 21:48
-
-
Save KirkMunro/badf56a4999dbbd77b6637f0f0c606be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region Fix important *nix commands. | |
# PowerShell comes with some predefined aliases built-in that are designed to | |
# ease the transition from *nix to PowerShell. While this is well-intentioned, | |
# it hides the true power that is available in these *nix commands, and it | |
# makes it much more difficult to compare and contrast between native commands | |
# in PowerShell and their *nix counterparts. This block of code removes the | |
# predefined aliases that would otherwise hide these important *nix commands. | |
foreach ($nixCommand in @('cat','cp','curl','diff','echo','kill','ls','man','mount','mv','ps','pwd','rm','sleep','tee','type','wget')) { | |
if (Test-Path -LiteralPath alias:${nixCommand}) { | |
Remove-Item -LiteralPath alias:${nixCommand} -Force | |
} | |
} | |
New-Alias -Name type -Value cat | |
function ls { | |
param() | |
if ($args -notcontains '--color') { | |
$args += '--color' | |
} | |
& ls.exe @args | |
} | |
#endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment