我想在Powershell中键入dir时看到彩色的文件名。因此,我从此处将Set-ChildItemColor函数添加到我的配置文件中。我还在配置文件的末尾添加了这一行,以覆盖dir别名:
Set-Alias dir Get-ChildItemColor
现在,当我打开Powershell时,出现此错误:
Set-Alias : The AllScope option cannot be removed from the alias 'dir'.
At C:\Users\joe\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:82
char:10
+ Set-Alias <<<<  dir Get-ChildItemColor
    + CategoryInfo          : WriteError: (dir:String) [Set-Alias], SessionStateUna
   uthorizedAccessException
    + FullyQualifiedErrorId : AliasAllScopeOptionCannotBeRemoved,Microsoft.PowerShe
   ll.Commands.SetAliasCommand
这是什么AllScope?如何删除该选项以获取彩色目录?
                  不知道为什么关闭了它。
                
                
                  
                    —
                    John Fouhy