Skip to content

Instantly share code, notes, and snippets.

@Y-Koji
Last active January 26, 2023 17:36
Show Gist options
  • Save Y-Koji/890504eff5252eaddbd6d251768f7329 to your computer and use it in GitHub Desktop.
Save Y-Koji/890504eff5252eaddbd6d251768f7329 to your computer and use it in GitHub Desktop.
PowerShell ダブルクリック起動Windows設定

PowerShell ps1ファイル レジストリ設定

.ps1のPowerShellスクリプトファイルをダブルクリックで直接起動できるようにするレジストリ設定です.

アイコンもPowerShellの実行ファイルアイコンに切り変えます.

PowerShellは6.0になります.

5以下を利用する場合,PowerShellの実行ファイルパスを適宜変えてください.

設定適応後アイコン

元のDefaultアイコン設定

"C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe",1

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open\Command]
@="\"C:\\Program Files\\PowerShell\\6.0.3\\pwsh.exe\" -noLogo -ExecutionPolicy unrestricted -file \"%1\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\DefaultIcon]
@="\"C:\\Program Files\\PowerShell\\6.0.3\\pwsh.exe\",0"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\ShellEx\DropHandler]
@="{60254CA5-953B-11CF-8C96-00AA00B8708C}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment