Powershell Error (show-command)

Hello

Sudenly I've started getting error in PowerShell (all the consoles: regular user, admin user, ISE with regular user, ISE with admin). And also commands tab in ISE is empty. Tried running with /noprofile switch, but with no luck.

OS is Windows 8.1.

Error:

PS C:\Windows\system32> Show-Command
get-command : Object reference not set to an instance of an object.
At line:1 char:3
+ @(get-command -CommandType Cmdlet,Function,Script,ExternalScript,Workflow),@(get ...
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-Command], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.GetCommandCommand

PSVersionTable:

PS C:\Windows\system32> $PSVersionTable

Name                       Value
----                            -----                         
PSVersion                      4.0                                                                                                                                              
WSManStackVersion       3.0                              
SerializationVersion        1.1.0.1                        
CLRVersion                    4.0.30319.34003          
BuildVersion                  6.3.9600.16394            
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.2      

  • Edited by Olegas D Thursday, January 16, 2014 2:03 PM
January 16th, 2014 4:59pm

Hi Olegas D,

Based on my research, Please try to check the errors based on the time in event log, and find if there is any error about loading profile failure etc.

This issue could be related to the user profile, and this thread may be helpful for you to troubleshoot:

Show-Command Error ISE:

http://social.technet.microsoft.com/Forums/windowsserver/en-US/b9663105-7973-494a-99c6-8265d6bb02f8/showcommand-error-ise?forum=winserverpowershell

I hope this helps.

Free Windows Admin Tool Kit Click here and download it now
January 17th, 2014 8:56am

Hi

Thanks for reply. I've seen that thread.
Tried creating ISE profiles (files were not there). Also tried /NoProfile switches.
Unfortunately deleting account is not possible.

January 17th, 2014 11:40am

Tested on a few other computers with Powershell 4. (Windows Server 2012) Having the same situation. Seems that it's expected behavior with PS 4. Or I'm missing something that need to be done for it to work :)


  • Edited by Olegas D Monday, January 20, 2014 9:26 AM
Free Windows Admin Tool Kit Click here and download it now
January 20th, 2014 12:26pm

Hi Olegas D,

Have you got any error message in event log?

Best Regards,

Anna

January 24th, 2014 4:06am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics