Powerhsell v2发布时崩溃

我在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= 

任何想法会造成这种情况? 它似乎随机启动。

这个论坛帖子似乎提示您的个人资料中缺少一个注册表项。

讨论摘录

再次分析进程监视器日志之后,如果以下注册表项丢失,则会发生此错误:

 HKEY_CURRENT_USER\Environment 

最终用户重建他的本地配置文件。

我也看到在PowerShell中运行以下命令的成功

 Set-ExecutionPolicy RemoteSigned