这里是我的个人资料的一部分:我的配置文件中的某些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 -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:\用户\ [用户名] \文档\ WindowsPowerShell \ Microsoft.PowerShell_profile.ps1
轮廓加载没有任何错误:
$ .$PROFILE
Loading profile v6...
但是open
别名未加载。
$ 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
'(gal open).ReferencedCommand' – PetSerAl
那是什么? .. – jcollum
如果这个命令没有错误地完成,那么加载'open'别名,并且这个命令显示由别名引用的命令。顺便说一句,你是否知道PowerShell不区分大小写? – PetSerAl