SQLPS.exe and PowerShell V2 $Host.Version dilemma answered…

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!!


About maxt2posh

I’m from Puerto Rico, have been working with computers since 1979. Throughout many years, I have worked with SQL Server Technologies, provided support to Windows Servers/Client machines, Microsoft Virtualization Technologies, and build some Visual Studio solutions. I’m a Microsoft PowerShell MVP since 2009 and MVP SAPIEN Technologies since 2010. I speak in most of the SQLSaturday, IT Pro and .NET camps events around the Florida’s State. Also founder of the Florida PowerShell User Group which meeting every 3rd Tuesday evening of the month.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s