9

I am attempting to create a solution to launch remote processes in an environment which is very stable, and I know the user base will have Windows 7 - most will have no updates to it though.

Remote SSIS Package Execution with PowerShell 2.0 says that Windows 7 comes with PowerShell 2.0 and would therefore be capable of the remote execution, but I seem to remember having to upgrade my machine to PowerShell 2. I am currently on v3 of PowerShell and don't have access to the machines on which the script would need to run.

What version of PowerShell comes with Windows 7 out of the box?

Thronk
  • 205
  • 1
  • 2
  • 8
  • You have the correct answer from the horse's mouth... Why ask again? – Austin T French Sep 26 '13 at 20:13
  • The path it is installed in on one of the machines is %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

    It is a strange path to install v2.0, no?

    – Thronk Sep 26 '13 at 20:14
  • I haven't updated Powershell on my Win7 machine and it's on v1. – Yass Sep 26 '13 at 20:14
  • Even though the path is %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe and made me think it was v1, I ran the following cmd and found it is in fact v2.
    Post this and I will mark it as an answer. I cannot as not enough status...

    PS C:\Users\tk> $psversiontable.psversion

    Major Minor Build Revision


    2 0 -1 -1

    – Thronk Sep 26 '13 at 20:16
  • @JohnBensin - I used get-host and you're right, it is version 2.0 – Yass Sep 26 '13 at 20:18
  • Thanks John, that also works (as does $psversiontable.psversion) – Thronk Sep 26 '13 at 20:18
  • Duplicate of http://stackoverflow.com/questions/1825585/how-to-determine-what-version-of-powershell-is-installed – Austin T French Sep 26 '13 at 20:34
  • 1
    @AthomSfere Cross-site duplicates are allowed, and since linked posts don't show up in the sidebar across SE sites, it's useful to have the information here as well. – John Bensin Sep 27 '13 at 16:30
  • 1
    @AthomSfere - Not same question anyway, as it is not "how to determine version" but "what version comes in Win7 without updates. – Thronk Apr 28 '14 at 20:25

1 Answers1

14

I recently installed Windows 7 on a fresh system, and running get-host in PowerShell tells me I'm running version 2.0, even though it's installed in the v1.0 folder.

Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

PS C:\Users\user> get-host


Name             : ConsoleHost
Version          : 2.0
InstanceId       : 61ef8a3b-0212-4743-87a1-eb2c00fb1e29
UI               : System.Management.Automation.Internal.Host.InternalHostUserI
                   nterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace
John Bensin
  • 1,607
  • 3
    $PSVersionTable would be a better way to check than get-host. See http://stackoverflow.com/a/1825807/1394393. – jpmc26 Dec 05 '14 at 02:10
  • Here is also a nice Microsoft Blog posting which talks about $PSVersionTable and the needed KBs to download the update. See https://blogs.technet.microsoft.com/heyscriptingguy/2014/11/09/weekend-scripter-install-powershell-4-0-in-windows-7/ – BastianW May 02 '16 at 17:32
  • A question with more comprehensive answers regarding finding the PowerShell version is Determine installed PowerShell version. – Peter Mortensen Feb 03 '17 at 17:40
  • Is this answer reliable, since the linked question says get-host doesn't return the correct information? Also, does the answer depend on what version of Windows 7 is installed? (e.g. do some installers come with SP1 built in?) – mwfearnley Jul 02 '18 at 09:43