3

どの変数が保護されているか、または定数であるかを知りたいと思っていたので、削除できる変数を確認することにしました。私が気付いていなかったのは、これらの変数の削除が ISE のこのセッションの範囲に限定されず、PowerShell グローバルであるだけでなく、システム グローバルであるということです。誰かが ISE を再び機能させるのを手伝ってくれることを願っています。

私の愚かさ:

Remove-Variable *  

...一連のエラーが報告され、dir variable:後で実行したときに残ったのはほんの一握り (10-15) でした。大したことではなく、ISE を再起動すれば正常に戻ると思い、ISE を閉じましたが、もう起動できません。

その他の症状

それ以来、環境変数%windir%がなくなったようなものを失ったことに気づきました-最も興味深いひねりで、高度なシステム設定を開いて%windir%\system32\systempropertiesadvanced.exeENVをバックアップすることができなくなります...(はい、直接実行できます)

更新: 追加の影響/症状が見つかりました: 自動更新が正常に機能しなかった後、正規バージョンの Windows を持っていない可能性があると Windows が報告しました。私は、いくつかの ENV 変数がなくなるという単純なことがそれを殺すことに気づいていませんでした。うーん。

それで、ISEを正常に実行するために必要な環境を復元または再作成する方法を知っている人はいますか?

(そして、はい、再起動と組み合わせて、機能を削除して再度追加しようとしました。)

4

2 に答える 2

2

ISE で remove-Variable * を実行しましたが、何も起こりませんでした。ISE を開いて通常どおり作業できます。また、-WhatIf実際に何が削除されるかを確認しました。

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 が完全に機能しなくなるかどうかはわかりません。

于 2011-04-15T04:58:41.907 に答える
0

支援してくれてありがとう-これが私がしたことです。どこでも100%戻ってきたかどうかはわかりませんが、ISE、Hyper-V Managerを使用して、本物であることを再度検証することができました。

別のServer2008R2ボックスに移動し、キーを比較してレジストリを手動で編集し、これらの値を壊れたマシンに追加し直しました。

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がセッションよりも影響を及ぼした根本的な理由として、私はISEの昇格された管理者特権に傾倒しています。

于 2011-04-15T17:22:23.537 に答える