2.0 version of System.Management.Automation?
Asked Answered
J

1

7

Is there a 2.0 (or greater) version of the System.Management.Automation assembly?

I'm looking at the PowerShell class in C# which says that this class was introduced with PowerShell 2.0. Does that version number correspond with the version number I'm seeing when I add the reference to the assembly in Visual Studio?

This is kind of an additional question to my other question which is in regards to having trouble resolving the PowerShell class inside that assembly.

I've tried the System.Management.Automation assembly in both the GAC:

C:\Windows\assembly\GAC_MSIL\System.Management.Automation\1.0.0.0__31bf3856ad364e35

And Reference Assemblies:

C:\Program Files\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0

Both containing folders only have version 1.0

I have PowerShell 2.0 installed.

Jumpoff answered 11/6, 2013 at 21:4 Comment(0)
P
7

The strong name version for both powershell v1 and powershell v2 is 1.0.0.0. Surprising, yes, but this is a function of the backwards compatibility design. Both powershell v1 and v2 run on CLR2. Powershell v3 runs on CLR4, so they bumped the strong name version to 3.0.0.0 for that one.

Just to confuse matters further, the windows folder name for all versions is v1.0 - again, for reasons of compatibility.

The only way you could actually be running the real powershell v1.0 is if you're on windows XP, vista or server 2003/2008. If you are running windows 7, 2008r2, you are on v2 at a minimum. If you are on 8 or 2012, you are on v3 of powershell at a minimum.

I hope this helps.

Portraitist answered 12/6, 2013 at 0:32 Comment(1)
I guess that answers my question, though I'm on Windows Server 2008 R2, so it would still strictly be version 1.0 but for PowerShell 2.0. Oh well. Back to my original question on getting that PowerShell class to resolve.Jumpoff

© 2022 - 2024 — McMap. All rights reserved.