I’ve been saying it over and over again, SQLPS.exe is self-contained mini-shell. This SQL PowerShell implementation can not be upgraded to PowerShell V2. Now, I will show why the both the $PSVersionTable (only available in V2) and the $Host.Version has the updated V2 version information.
This comes down to DLL’s dependencies. I downloaded from Microsoft SysInternal site the “Process Explorer” utility and run it to check SQLPS.exe on my Developer PC (Vista machine) at work. Here’s the results:
(SQLPS.exe – PowerShell dll’s dependencies)
(PowerShell.exe – dll’s dependencies)
Now, In one of our SQL Server, not having SQL Server 2008 installed, but have PowerShell V1 installed will show the following dll’s version:
(PowerShell V1 – dll’s dependencies)
So, this clearly shows that when upgrade to PowerShell V2 in your SQL Server 2008 box, the dll’s dependencies will cause $PSVersionTable to show that’s SQLPS.exe is on V2.
I hope this clear any concerns about SQLPS vs. PowerShell V2.
Happy PowerShell Scripting!!