Spaces in commandline path #21206

Open
opened 2026-01-31 07:36:31 +00:00 by claunia · 0 comments
Owner

Originally created by @taschemann on GitHub (Feb 6, 2024).

Windows Terminal version

1.18.231114001

Windows build number

10

Other Software

No response

Steps to reproduce

I'm trying to load a custom PowerShell profile that is stored in %OneDrive%, but the path to OneDrive contains multiple spaces in it and I can't figure out how to escape the spaces, even when I spell the path out and explicitly escape them. This is my employer's setup, so the path can't be changed and I can't put the PowerShell profile in a different location. Is it possible to load the profile with Windows Terminal? Can I escape the spaces somehow?

Expected Behavior

I want to use powershell.exe -File %OneDrive%/path/to/profile.ps1 and have the profile load, whether there are spaces in the path or not.

Actual Behavior

PowerShell doesn't start because the path can't be traversed properly.

Originally created by @taschemann on GitHub (Feb 6, 2024). ### Windows Terminal version 1.18.231114001 ### Windows build number 10 ### Other Software _No response_ ### Steps to reproduce I'm trying to load a custom PowerShell profile that is stored in %OneDrive%, but the path to OneDrive contains multiple spaces in it and I can't figure out how to escape the spaces, even when I spell the path out and explicitly escape them. This is my employer's setup, so the path can't be changed and I can't put the PowerShell profile in a different location. Is it possible to load the profile with Windows Terminal? Can I escape the spaces somehow? ### Expected Behavior I want to use `powershell.exe -File %OneDrive%/path/to/profile.ps1` and have the profile load, whether there are spaces in the path or not. ### Actual Behavior PowerShell doesn't start because the path can't be traversed properly.
claunia added the Needs-TriageIssue-BugNeeds-Author-FeedbackNo-Recent-Activity labels 2026-01-31 07:36:31 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21206