2.0 version of System.Management.Automation?

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

I am considering a PowerShell class in C # that says that this class was introduced using PowerShell 2.0 . Does the version number correspond to the version number that I see when I add the assembly reference in Visual Studio?

This is an additional question to my other question , which is that it has problems resolving the PowerShell class inside this assembly.

I tried building System.Management.Automation as in 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 folders contain only version 1.0

I have PowerShell 2.0 installed.

+6
source share
1 answer

The strong version of the name for powershell v1 and powershell v2 is 1.0.0.0 . Surprisingly, yes, but it is a backward compatibility design feature. Both powershell v1 and v2 run on CLR2. Powershell v3 runs on CLR4, so they came up with a strong version of the name at 3.0.0.0 for this.

To further complicate matters, the Windows folder name for all versions is v1.0 - again, for compatibility reasons.

The only way to run the real version of powershell v1.0 is if you are on Windows XP, Vista or a 2003/2008 server. If you are using Windows 7, 2008r2, you are at least on v2. If you are on 8 or 2012, you are at least on v3 powershell.

Hope this helps.

+6
source

Source: https://habr.com/ru/post/947056/


All Articles