Is there an easy way to check backward compatibility for powershell scripts?

I wrote a powerhell script, and it should work in both version 1 and version 2.

Can more than one version of powershell coexist on the same machine? Or should I have powershell versions in a separate machine?

+6
source share
1 answer

Well, the answer is yes and no.

Technically, in PowerShell 2.0, you can access PowerShell 1.0 with

version 1

powershell.exe parameter

Similarly, in PowerShell 3.0, you can use Verison 2.0 PowerShell using

version 2

You cannot install both separately on the same computer. PowerShell itself provides a way to migrate to an earlier version.

+7
source

All Articles