Determine installed PowerShell version

前端 未结 19 2397
半阙折子戏
半阙折子戏 2020-11-22 09:40

How can I determine what version of PowerShell is installed on a computer, and indeed if it is installed at all?

19条回答
  •  情歌与酒
    2020-11-22 10:19

    I found the easiest way to check if installed was to:

    • run a command prompt (Start, Run, cmd, then OK)
    • type powershell then hit return. You should then get the PowerShell PS prompt:

    C:\Users\MyUser>powershell
    
    Windows PowerShell
    Copyright (C) 2009 Microsoft Corporation. All rights reserved.
    
    PS C:\Users\MyUser>
    

    You can then check the version from the PowerShell prompt by typing $PSVersionTable.PSVersion:

    PS C:\Users\MyUser> $PSVersionTable.PSVersion
    
    Major  Minor  Build  Revision
    -----  -----  -----  --------
    2      0      -1     -1
    
    PS C:\Users\MyUser>
    

    Type exit if you want to go back to the command prompt (exit again if you want to also close the command prompt).

    To run scripts, see http://ss64.com/ps/syntax-run.html.

提交回复
热议问题