右键单击 Powershell 文件时,我的“编辑”上下文操作消失了

sha*_*p00 6 powershell windows-8 powershell-ise

我似乎丢失了用于启动 Powershell ISE 的 *.ps1 文件的右键单击编辑操作。我怎样才能取回它?

我认为它一定是在我安装和卸载PowerGui之后发生的。

wtj*_*nes 6

这也发生在我身上。将以下内容作为 .reg 文件导入以修复它。我做了一个调整,导致默认的 shell 操作(双击)使用编辑命令(ISE)而不是打开(notepad.exe)。如果您不在乎,只需将第 7 行更改为@="Open"

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\DefaultIcon]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe\",1"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell]
@="Edit"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit]

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe\" \"%1\""

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open]

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open\Command]
@="\"C:\\Windows\\System32\\notepad.exe\" \"%1\""
Run Code Online (Sandbox Code Playgroud)