Skip to content

Commit 9448fbb

Browse files
committed
create shortcut to wt.exe
1 parent a9e35a7 commit 9448fbb

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Diff for: Install-Programs.ps1

+12-3
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,9 @@ Begin
612612
{
613613
[CmdletBinding(HelpURI = 'manualcmd')] param()
614614

615+
$appName = 'Microsoft.WindowsTerminal'
616+
$appKey = '8wekyb3d8bbwe'
617+
615618
$parentId = (gwmi win32_process -Filter "processid='$pid'").parentprocessid
616619
if ((gwmi win32_process -Filter "processid='$parentId'").Name -eq 'WindowsTerminal.exe')
617620
{
@@ -621,9 +624,9 @@ Begin
621624

622625
Chocolatize 'microsoft-windows-terminal'
623626

624-
# customize settings... for Terminal v1.8.1444.0
627+
# customize settings... for Terminal 1.8.1444.0, 1.9.1942.0
625628

626-
$0 = "$($env:LOCALAPPDATA)\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json"
629+
$0 = "$($env:LOCALAPPDATA)\Packages\$appName`_$appKey\LocalState\settings.json"
627630
if (!(Test-Path $0))
628631
{
629632
# when Terminal is first installed, no settings file exists so download default
@@ -637,6 +640,7 @@ Begin
637640

638641
$settings.initialCols = 160
639642
$settings.initialRows = 90
643+
$settings.initialPosition = '200,25'
640644

641645
$scheme = New-Object -TypeName PsObject -Property @{
642646
background = '#080808'
@@ -704,8 +708,13 @@ Begin
704708
# object properties to key/value collections
705709
ConvertTo-Json $settings -Depth 100 | Out-File $0 -Encoding Utf8
706710

711+
# Create shortcut to pin to taskbar
712+
$version = (choco list -l -r -e microsoft-windows-terminal).Split('|')[1]
713+
New-RunasShortcut C:\Tools\wt.lnk "$($env:ProgramFiles)\WindowsApps\$appName`_$version`_x64__$appKey\wt.exe"
714+
707715
$reminder = 'Windows Terminal', `
708-
' 0. initialPosition can be set globally in settings.json ("x,y" value)'
716+
" 0. Pin C:\Tools\wt.lnk to Taskbar", `
717+
' 1. initialPosition can be set globally in settings.json ("x,y" value)'
709718

710719
$script:reminders += ,$reminder
711720
Highlight $reminder 'Cyan'

0 commit comments

Comments
 (0)