【问题标题】:Powerhsell v2 crashing on launchPowershell v2 在启动时崩溃
【发布时间】:2014-09-12 13:36:29
【问题描述】:

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

知道是什么原因造成的吗?它似乎是随机启动的。

【问题讨论】:

    标签: windows powershell windows-xp


    【解决方案1】:

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

    讨论节选

    再次分析进程监视器日志后,我发现如果缺少以下注册表项,则会出现此错误:

    HKEY_CURRENT_USER\Environment
    

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

    我还看到有人在 powershell 中运行以下命令取得成功

    Set-ExecutionPolicy RemoteSigned
    

    【讨论】:

    • 赢家!太感谢了!我需要在密钥中添加“HKEY_CURRENT_USER\Environment”以及一些条目。这似乎已经解决了所有问题。
    • 我可以通过添加用户(而非系统)PATH 环境变量来解决此问题;在不使用 regedit 的情况下创建了所需的注册表项。我的电脑 > 属性 > 高级系统设置 > 环境变量 > 窗口的上半部分 > 新建 > PATH 和 C:\Windows\System32 > 保存并确定。
    猜你喜欢
    • 1970-01-01
    • 2013-09-22
    • 2016-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多