Powershell ISE无法启动愚蠢地删除所有变量

如何解决Powershell ISE无法启动愚蠢地删除所有变量

| 我急切地想找出哪些变量是受保护的或常量,我决定只看一下可以删除哪些变量-假设上面提到的那些变量将不予处理。我没有意识到的是,删除这些变量将不仅限于ISE本届会议的范围-不仅是PowerShell全局的-而是系统全局的。我希望有人可以帮助我使ISE重新工作。 我的愚蠢:
Remove-Variable *  
...导致了一系列错误报告,之后我执行
dir variable:
时只剩下极少数(10-15)。认为这没什么大不了的,并且重启ISE可以使我恢复正常,所以我关闭了它-并且我无法启动它了。 其他症状 从那以后,我发现我丢失了诸如环境变量
%windir%
之类的东西-这是最有趣的转折,它阻止您打开高级系统设置(找不到
%windir%\\system32\\systempropertiesadvanced.exe
)来设置ENV备份。 ..(是的,我可以直接运行它) 更新:我发现了其他效果/症状:Windows报告说自动更新无法正常工作后,我可能没有Windows的正版版本。我还没有意识到,像某些ENV变量那样简单的事情会杀死它。嗯 那么-谁知道如何还原或重新创建成功运行ISE所需的环境? (是的,我尝试过删除并重新添加功能,并重新启动。)     

解决方法

我刚才在ISE中做了remove-Variable *,什么也没发生。我仍然可以打开ISE并照常工作。我还花了4英镑来看看真正删除的内容。
PS H:\\> Remove-Variable * -WhatIf
What if: Performing operation \"Remove Variable\" on Target \"Name: null\".
What if: Performing operation \"Remove Variable\" on Target \"Name: false\".
What if: Performing operation \"Remove Variable\" on Target \"Name: true\".
What if: Performing operation \"Remove Variable\" on Target \"Name: MaximumErrorCount\".
What if: Performing operation \"Remove Variable\" on Target \"Name: MaximumVariableCount\".
What if: Performing operation \"Remove Variable\" on Target \"Name: MaximumFunctionCount\".
What if: Performing operation \"Remove Variable\" on Target \"Name: MaximumAliasCount\".
What if: Performing operation \"Remove Variable\" on Target \"Name: MaximumDriveCount\".
What if: Performing operation \"Remove Variable\" on Target \"Name: Error\".
What if: Performing operation \"Remove Variable\" on Target \"Name: PWD\".
What if: Performing operation \"Remove Variable\" on Target \"Name: ?\".
What if: Performing operation \"Remove Variable\" on Target \"Name: MaximumHistoryCount\".
What if: Performing operation \"Remove Variable\" on Target \"Name: Host\".
What if: Performing operation \"Remove Variable\" on Target \"Name: HOME\".
What if: Performing operation \"Remove Variable\" on Target \"Name: ExecutionContext\".
What if: Performing operation \"Remove Variable\" on Target \"Name: PSVersionTable\".
What if: Performing operation \"Remove Variable\" on Target \"Name: PID\".
What if: Performing operation \"Remove Variable\" on Target \"Name: PSCulture\".
What if: Performing operation \"Remove Variable\" on Target \"Name: PSUICulture\".
What if: Performing operation \"Remove Variable\" on Target \"Name: ShellId\".
What if: Performing operation \"Remove Variable\" on Target \"Name: PSHOME\".
What if: Performing operation \"Remove Variable\" on Target \"Name: ConsoleFileName\".
What if: Performing operation \"Remove Variable\" on Target \"Name: $\".
What if: Performing operation \"Remove Variable\" on Target \"Name: ^\".
What if: Performing operation \"Remove Variable\" on Target \"Name: StackTrace\".
What if: Performing operation \"Remove Variable\" on Target \"Name: OutputEncoding\".
What if: Performing operation \"Remove Variable\" on Target \"Name: ConfirmPreference\".
What if: Performing operation \"Remove Variable\" on Target \"Name: DebugPreference\".
What if: Performing operation \"Remove Variable\" on Target \"Name: ErrorActionPreference\".
What if: Performing operation \"Remove Variable\" on Target \"Name: ProgressPreference\".
What if: Performing operation \"Remove Variable\" on Target \"Name: VerbosePreference\".
What if: Performing operation \"Remove Variable\" on Target \"Name: WarningPreference\".
What if: Performing operation \"Remove Variable\" on Target \"Name: ErrorView\".
What if: Performing operation \"Remove Variable\" on Target \"Name: NestedPromptLevel\".
What if: Performing operation \"Remove Variable\" on Target \"Name: ReportErrorShowExceptionClass\".
What if: Performing operation \"Remove Variable\" on Target \"Name: ReportErrorShowInnerException\".
What if: Performing operation \"Remove Variable\" on Target \"Name: ReportErrorShowSource\".
What if: Performing operation \"Remove Variable\" on Target \"Name: ReportErrorShowStackTrace\".
What if: Performing operation \"Remove Variable\" on Target \"Name: WhatIfPreference\".
What if: Performing operation \"Remove Variable\" on Target \"Name: FormatEnumerationLimit\".
What if: Performing operation \"Remove Variable\" on Target \"Name: PSEmailServer\".
What if: Performing operation \"Remove Variable\" on Target \"Name: PSSessionOption\".
What if: Performing operation \"Remove Variable\" on Target \"Name: PSSessionConfigurationName\".
What if: Performing operation \"Remove Variable\" on Target \"Name: PSSessionApplicationName\".
What if: Performing operation \"Remove Variable\" on Target \"Name: psUnsupportedConsoleApplications\".
What if: Performing operation \"Remove Variable\" on Target \"Name: PSBoundParameters\".
What if: Performing operation \"Remove Variable\" on Target \"Name: args\".
What if: Performing operation \"Remove Variable\" on Target \"Name: input\".
What if: Performing operation \"Remove Variable\" on Target \"Name: MyInvocation\".
What if: Performing operation \"Remove Variable\" on Target \"Name: _\".
What if: Performing operation \"Remove Variable\" on Target \"Name: psLocalHelp\".
What if: Performing operation \"Remove Variable\" on Target \"Name: psOnlineHelp\".
What if: Performing operation \"Remove Variable\" on Target \"Name: psISE\".
What if: Performing operation \"Remove Variable\" on Target \"Name: profile\".
注意该列表中确实包含了所有内容。顺便说一句,这些只是ISE运行空间中的变量。我不确定删除这些变量将如何阻止ISE完全起作用。     ,谢谢大家的帮助-这是我所做的,虽然我不确定到哪里都能使我100%回来,但它使我能够使用ISE,Hyper-V管理器并再次验证为正品。 我转到另一个Server 2008 R2框,比较了密钥并手动编辑了注册表,并将这些值添加回损坏的计算机:
HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment
  Path=C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;
  PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
  PSModulePath=C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\
  TEMP=C:\\Windows\\TEMP
  TMP=C:\\Windows\\TEMP
  windir=C:\\Windows
我倾向于提高ISE的管理员特权,因为它比会话影响更大的根本原因。     

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?