`powershell -version`はLinuxでは動作しません。

`powershell -version`はLinuxでは動作しません。

ただインストールしました。Linux用PowerShellのオープンソースバージョンArch Linuxで使用これpowershell-gitパック~から尿素尿の割合。 PowerShell-Version機能を試みると、次のメッセージが表示されます。

PS /home/user> powershell -Version 5.1                                          
-Version : The term '-Version' 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.
At line:1 char:1
+ -Version 5.1
+ ~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (-Version:String) [], CommandNot 
   FoundException
    + FullyQualifiedErrorId : CommandNotFoundException

この問題をどのように解決しますか?

ベストアンサー1

PowerShellはWindows用に書かれており、基本ファイルシステムが大文字と小文字を区別しないと想定しています。 PowerShellコマンドを入力すると、プログラムは入力した内容を読み取り、実際に発生する状況に合わせます。しなければならない存在し、それを再現してください。

これPowerShellに関するヘルプメッセージこのオプションは次のように表示されます。-Version:

-Version
    Starts the specified version of Windows PowerShell. 
    Enter a version number with the parameter, such as "-version 2.0".

エラーメッセージは、ファイルシステムの完全なスペル名の概念を使用して一致するものを見つけることが期待されることを示します。ヘルプメッセージに表示されている大文字と小文字を混在させる名前を使用すると、より良い成功を収めることができます。

おすすめ記事