为Windows Terminal添加右键菜单

复制代码到powershell中

powershell7

1
2
3
4
5
6
7
8
9
10
11
$wt_reg="$env:TEMP\$((Get-Date).Ticks).reg"
Set-Content -Path $wt_reg 'Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\wt]
@="Windows Terminal(&Z)"

[HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command]
@="wt pwsh -wd \"%V\""
'
REG IMPORT $wt_reg

Windows Powershell

1
2
3
4
5
6
7
8
9
10
11
$wt_reg="$env:TEMP\$((Get-Date).Ticks).reg"
Set-Content -Path $wt_reg 'Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\wt]
@="Windows Terminal(&Z)"

[HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command]
@="wt powershell -NoLogo -NoExit -Command &{Set-Location ''%V''}"
'
REG IMPORT $wt_reg