2017-06-29 3 views
1

は私のプロフィールのセクションです:私のプロフィールにPowershellエイリアスが読み込まれていないのはなぜですか?ここ

C:\ Users \ユーザー[ユーザー名] \ドキュメント\ WindowsPowerShell \ Microsoft.PowerShell_profile.ps1

プロファイル

#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..." 

私のプロフィールはですエラーなしのロード:

$ .$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 
+0

'(gal open).ReferencedCommand' – PetSerAl

+0

これは何ですか? .. – jcollum

+0

このコマンドがエラーなしで完了すると、 'open'エイリアスがロードされ、このコマンドはエイリアスによって参照されるコマンドを表示します。ところで、PowerShellは大文字と小文字を区別しないことに気付いていますか? – PetSerAl

答えて

0

Set-Alias open Start-Process 

を使用してみてください....はありません。

+0

ああ、私のエイリアスを殺していたのは大文字小文字の区別でした。 powershellはさまざまなコマンドに対して大文字と小文字を区別する引数を使用しますが、大文字と小文字は区別されません。 – jcollum

+0

エイリアスでは大文字と小文字を区別しないでください。エイリアスは、私がコマンドをどのように入力しても関係なく動作します。 –

+0

私の元のコードでは、大文字と小文字の区別に依存していました。 – jcollum

関連する問題