diff --git a/chezmoi/.chezmoiscripts/run_30-create-codex-proxy-shortcut.ps1 b/chezmoi/.chezmoiscripts/run_30-create-codex-proxy-shortcut.ps1 index 0293587..622ad4b 100644 --- a/chezmoi/.chezmoiscripts/run_30-create-codex-proxy-shortcut.ps1 +++ b/chezmoi/.chezmoiscripts/run_30-create-codex-proxy-shortcut.ps1 @@ -12,8 +12,11 @@ if ([string]::IsNullOrWhiteSpace($ProgramsPath)) { } $ShortcutPath = Join-Path $ProgramsPath 'Codex Proxy.lnk' +$PwshAliasPath = Join-Path $env:LOCALAPPDATA 'Microsoft\WindowsApps\pwsh.exe' $PwshCommand = Get-Command pwsh -ErrorAction SilentlyContinue -if ($null -ne $PwshCommand) { +if (Test-Path -LiteralPath $PwshAliasPath) { + $TargetPath = $PwshAliasPath +} elseif ($null -ne $PwshCommand) { $TargetPath = $PwshCommand.Source } else { $TargetPath = 'pwsh.exe'