我的配置文件中的某些Powershell别名未加载,为什么?

我的配置文件中的某些Powershell别名未加载,为什么?,powershell,Powershell,以下是我个人资料的一部分: #alias gs='git status' function GitStatus { & git status $args } Set-Alias -Option AllScope -Name gs -Value GitStatus # aliases - other ---------------------------------- function Touch { & echo $null >> $args } Set-Alias

以下是我个人资料的一部分:

#alias gs='git status'
function GitStatus { & git status $args }
Set-Alias -Option AllScope -Name gs -Value GitStatus

# aliases - other ----------------------------------
function Touch { & echo $null >> $args }
Set-Alias -Option AllScope -Name touch -Value Touch
function LL { & ls }
Set-Alias -Option AllScope -Name ll -Value LL
function Open { & Invoke-Item $args }
Set-Alias -Option AllScope -Name open -Value Open

echo "Loading profile v6..."
我的个人资料位于:

C:\Users\[USER NAME]\Documents\WindowsPowerShell\Microsoft.PowerShell\u profile.ps1

配置文件加载时没有任何错误:

$ .$PROFILE
Loading profile v6...
但是未加载
打开的
别名

$ open .\coverage\report.html
open : The term 'open' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
但是
gs
别名是

$ gs
On branch f/listener
Changes to be committed:
那么,我是如何进入这样一种情况的:我的一些别名加载了,而另一些没有加载?配置文件加载时没有错误

$ $PSVersionTable.PSVersion
Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      14393  1198
试用

Set-Alias open Start-Process
我已经测试过了,它对我有效。

尝试使用

Set-Alias open Start-Process

我进行了测试,它对我有效。

(gal-open)。ReferencedCommand
这是什么。。如果此命令正确完成,则加载
open
alias,并且此命令显示alias引用的命令。顺便说一句,您知道PowerShell不区分大小写吗?为什么要为
open
==
open
?Powershell函数调用和变量不区分大小写。我的猜测是,使用一个不必要的别名会导致问题。我想要一些与bash匹配的东西
open file.html
将在bash中工作,但我现在在Windows上
(gal-open)。ReferencedCommand
那是什么。。如果此命令正确完成,则加载
open
alias,并且此命令显示alias引用的命令。顺便说一句,您知道PowerShell不区分大小写吗?为什么要为
open
==
open
?Powershell函数调用和变量不区分大小写。我的猜测是,使用一个不必要的别名会导致问题。我想要一些与bash匹配的东西
open file.html
将在bash中工作,但我现在在Windows上,所以区分大小写的问题扼杀了我的别名;令人奇怪的是,powershell对各种命令使用区分大小写的参数,而总体上不区分大小写。别名不应该区分大小写。无论我如何输入命令,别名都适用于我。在我的原始代码中,我依赖于区分大小写。啊,正是区分大小写扼杀了我的别名;令人奇怪的是,powershell对各种命令使用区分大小写的参数,而总体上不区分大小写。别名不应该区分大小写。无论我如何输入命令,别名都适用于我。在我的原始代码中,我依赖于大小写敏感度。