Powershell v2 chiarimenti sulla versione

Powershell v2 è istallata per default in Windows 7 e Windows 2008 R2 in %WinDir%\System32\WindowsPowerShell\v1.0 e questo può far pensare che la versione non sia la 2, ma la 1.

Il motivo del nome v1.0 della cartella è spiegato nel seguente CTP: Versioning:

“If version 2.0 is installed on Windows 7, why is it installed in the Windows\System32\WindowsPowerShell\v1.0 folder?

Yes, the .exe is in the v1.0 folder.  The use of “v1.0” has more to do with the fact that the same version of the .NET CLR is being used even with v2.

Inoltre sempre dallo stesso ecco alcune considerazioni da tenere presente:

  • The PowerShell CTP REPLACES PowerShell V1.0. They do not run side-by-side.
    (ovviamente una soluzione per ovviare a questo limite è usare l’XP Mode come indicato in Running PowerShell 1.0 and 2.0 on the same machine).
  • PowerShell CTP is compatible with PowerShell V1.0. Your V1.0 cmdlet, providers and scripts should work without modification on the CTP.
  • PowerShell Scripts continue to use “.PS1”.

Per avere Powershell in sistemi operativi precedenti a Windows 7 e Windows 2008 R2 si veda Description of the Windows Management Framework on Windows XP, Windows Server 2003, Windows Vista, and Windows Server 2008.

Per verificare la versione è possibile utilizzare la variabile $psversiontable

image