Powershell v2在发布时崩溃

时间:2014-07-21 21:47:32

标签: windows powershell windows-xp

我在Windows XP SP3机器上安装了PowerShell v2,当我今天打开PowerShell时它说:

The shell cannot be started. A failure occurred during initialization:
Object reference not set to an instance of an object.

Powershell事件日志中的事件是:

Soruce: Powershell
Category: engine health
Event ID: 103

Settings: Object reference not set to an instance of an object. 

Details: 
ExceptionClass=NullReferenceException
ErrorCategory=
ErrorId=
ErrorMessage=Object reference not set to an instance of an object.

Severity=Error

SequenceNumber=

HostName=ConsoleHost
HostVersion=2.0
HostId=0fba5d45-885f-4f19-a354-4b390d5605bd
EngineVersion=2.0
RunspaceId=db9879d6-247a-40d7-9bfe-5bfd07a973f0
PipelineId=
CommandName=
CommandType=
ScriptName=
CommandPath=
CommandLine=

任何想法会导致什么?它似乎是随机开始的。

1 个答案:

答案 0 :(得分:3)

This forum post似乎建议您的个人资料中缺少注册表项。

讨论摘录

  

再次分析Process Monitor日志后,如果缺少以下注册表项,我发现发生此错误:

HKEY_CURRENT_USER\Environment

最终用户重建了他的本地资料。

我也看到人们在powershell中运行以下命令的成功

Set-ExecutionPolicy RemoteSigned