Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wanted to see colorized filenames when I typed dir in Powershell. So, I added the Set-ChildItemColor function from here to my profile file. I also added this line at the end of the profile file to override the dir alias:

Set-Alias dir Get-ChildItemColor

Now, when I open Powershell, I get this error:

Set-Alias : The AllScope option cannot be removed from the alias 'dir'.
At C:\Users\joe\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:82
+ Set-Alias <<<<  dir Get-ChildItemColor
    + CategoryInfo          : WriteError: (dir:String) [Set-Alias], SessionStateUna
    + FullyQualifiedErrorId : AliasAllScopeOptionCannotBeRemoved,Microsoft.PowerShe

What is this AllScope? How do I remove that option to get colorized dir?

share|improve this question
Not sure why this was closed.. I had exactly this ("AllScope option cannot be removed") and the answer below solved my problem. – John Fouhy Aug 5 '13 at 4:32

Use the -Option parameter of Set-Alias.

Set-Alias -Name dir -Value Set-ChildItemColor -Option AllScope

See Get-Help Set-Alias and Get-Help about_Scope for details.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.