axodotdev / axodotdev/cargo-dist

Installer script path with spaces causes PowerShell `CommandNotFoundException` on Windows

Open Beginner friendly
#2,337 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.1k
Forks
149
Avg merge
1d 11h
Merged PRs (30d)
32

Description

When the Windows username contains a space (e.g. `Sha Roze`), the temp path used to invoke the downloaded `.ps1` installer script is not quoted. PowerShell tokenizes the path on the space, treating the first segment as a command name, causing the update to fail entirely.

I encountered this bug when trying to update uv using its self update command.

### Steps to Reproduce

1. Have a Windows user account whose name contains a space (e.g. `C:\Users\Sha Roze`)
2. Install `uv` via the standalone installer
3. Run `uv self update`

### Error Output

```
C:\Users\Sha : The term 'C:\Users\Sha' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
At line:1 char:1
+ C:\Users\Sha Roze\AppData\Local\Temp\.tmpGjtrqF\installer.ps1
+ ~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\Sha:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
```

### Environment

- OS: Windows
- Shell: PowerShell

- uv issue: https://github.com/astral-sh/uv/issues/7988

Contributor guide

Open the contributing guide

Research direction

Start by tracing the `uv self update` flow to where it invokes the downloaded PowerShell installer script. Check how the temporary script path is passed to PowerShell when it contains spaces. Done means the update succeeds for a Windows username with a space, without the reported `CommandNotFoundException`.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, rust
Domain
release
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.