sqlps and PowerShell V2 Issues - by cmille19

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 484732 Comments
Status Closed Workarounds
Type Bug Repros 2
Opened 8/23/2009 7:45:32 AM
Access Restriction Public


When using the SQL Server 2008 PowerShell host, sqlps on a system with PowerShell V2 installed certain commands produce errors. The Get-Command for instance produces the following the output:

Get-Command : Object reference not set to an instance of an object.
At line:1 char:12
+ get-command <<<<
    + CategoryInfo          : NotSpecified: (:) [Get-Command], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.GetCommandCommand

The same command running on a system with sqlps and PowerShell V1 executes successfully.
Sign in to post a comment.
Posted by CSMGC on 10/21/2010 at 3:40 PM
This is listed as closed but still a problem on SQL 2008 R2 (10.50.1600) has this been opened as a new issue for R2?
Posted by Bob Beauchemin on 5/10/2010 at 3:02 PM
Was this fix (or will the fix be) forward-ported to SQL Server 2008 R2?
Posted by Microsoft on 5/4/2010 at 7:57 AM
Hi Chad,
     I'd like to inform you that we have fixed this issue with the upcoming SQL 2008 SP2 release that will be out later this year. It turned out that we weren't handing one of the parameters to the get-command call that caused the problem.
Thank you,
Bill Ramos
Posted by Stephen Mills on 3/6/2010 at 12:20 PM
It's been 2 months since Microsoft said it was a confirmed issue and were talking with the PowerShell team about this and almost 7 months since it was entered as a bug. Is there a resolution for this yet? Or is PowerShell V2 not really supported in SQL Server 2008? Since SQL Server 2008 is fairly new and 2008 R2 isn't out yet, it would be sad if they decided to ignore it. I really hope they reply soon and say that they have a fix.
Posted by Varsham Papikian on 1/27/2010 at 10:38 AM
In my environment I have PS 2.0 and SQL Server Dev 2008, OS is Vista Business 64bit. I have the same issue.

And just a comment for the reply from Microsoft from 1/5/2010: in my case switching to a sub-directory from Root while under SQL provider makes NO difference. But switching to C: (file-system) DOES work. It goes without saying that the issue 'comes back' when you switch to SQL Provider again.
Posted by Microsoft on 1/5/2010 at 10:38 AM
We have confirmed the issue and are currently discussing with the PowerShell team.

This issue only occurs in the root of the SQL provider so the workaround is to switch to a sub-directory of the provider or to a different drive before running get-command.
Posted by Stephen Mills on 9/23/2009 at 7:22 AM
Unless they aren't going to support running SQL Server 2008 on Windows Server 2008 R2, this needs to be addressed. PowerShell V2 is also considered an Operating System update on Windows Server 2008, Windows Server 2003, XP, and Vista not a seperate feature. It will look bad for the SQL team if they effectively stop support for SQL 2008 even before SQL 2008 R2 is released.
Posted by jeffw8713 on 8/23/2009 at 8:55 AM
I was able to reproduce this - using both SQLPS.EXE and the SQL Server Provider from Powershell V2. Get-Command fails if you set the location to SQLSERVER:\ when using the provider from a standard Powershell V2 session.