首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >‘`powershell -version`在Linux上不工作

问‘`powershell -version`在Linux上不工作
EN

Unix & Linux用户
提问于 2016-08-31 03:42:31
回答 1查看 2.2K关注 0票数 2

我刚刚使用来自Linux的PowerShell开放源码版本的这个powershell-git套餐在Arch上安装了奥尔。当我尝试PowerShell的-Version功能时,我得到以下信息:

代码语言:javascript
复制
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

怎么解决这个问题?

EN

回答 1

Unix & Linux用户

发布于 2016-08-31 08:16:51

PowerShell是为Windows编写的,它假定底层文件系统的情况并不重要。当您输入一个PowerShell命令时,程序会读取您输入的任何内容,然后将其与其对情况应该是什么的想法进行匹配并重新显示。

PowerShell的帮助消息将该选项显示为-Version:

代码语言:javascript
复制
-Version
    Starts the specified version of Windows PowerShell. 
    Enter a version number with the parameter, such as "-version 2.0".

错误消息是说,它希望使用文件系统的完全拼写名称的概念找到匹配。如果使用帮助消息中所示的混合大小写名称,您可能会获得更好的成功。

票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/306868

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档