You are currently offline, waiting for your internet to reconnect

Error message when you run Get-Command in a PowerShell version 2 environment on a server that is running SQL Server 2008 or SQL Server 2008 R2: "Object reference not set to an instance of an object"

SYMPTOMS
Consider the following scenario:
  • You have Windows PowerShell version 2 installed on a computer that is running Microsoft SQL Server 2008 or Microsoft SQL Server 2008 R2.
  • You run the sqlps utility to start the PowerShell environment.
  • At the command prompt, you run the Get-Command command to retrieve a list of available commands.

In this scenario, you receive the following error message:
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

RESOLUTION

Service pack information for SQL Server 2008

To resolve this problem, obtain the latest service pack for SQL Server 2008. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
968382 How to obtain the latest service pack for SQL Server 2008

Service pack information for SQL Server 2008 R2

To resolve this problem, obtain the latest service pack for SQL Server 2008 R2. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2527041How to obtain the latest service pack for SQL Server 2008 R2
STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

This problem was first corrected in Microsoft SQL Server 2008 Service Pack 2.
This problem was first corrected in SQL Server 2008 R2 Service Pack 1.
MORE INFORMATION
For more information about the sqlps utility, see the following topic on the Microsoft TechNet website:
Properties

Article ID: 2216478 - Last Review: 04/22/2011 17:50:00 - Revision: 3.0

  • Microsoft SQL Server 2008 Enterprise
  • Microsoft SQL Server 2008 Developer
  • Microsoft SQL Server 2008 Standard
  • Microsoft SQL Server 2008 R2 Developer
  • Microsoft SQL Server 2008 R2 Enterprise
  • Microsoft SQL Server 2008 R2 Standard
  • kbinfo kbexpertiseinter kbprb kbbug kbtshoot kbsurveynew KB2216478
Feedback
" data-bi-slot="2"> Privacy & cookies
  • Trademarks
  • © 2015 Microsoft