Skip to content

[DotNet Core Global] pwsh fails when user name contains spaces #10184

@eobeda

Description

@eobeda

Steps to reproduce

After installing as a global DotNet command,
dotnet tool install --global PowerShell

execute a simple command
pwsh -c Get-Date

Expected behavior

Display today's date.

Actual behavior

 C:\Users\ed obeda>dotnet tool install --global PowerShell

You can invoke the tool using the following command: pwsh
Tool 'powershell' (version '6.2.2') was successfully installed. 

Note the space in my user name. Changing execution location ie c:\ does not resolve the issue.

C:\Users\ed obeda>pwsh -c Get-Date

Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET Core program, but dotnet-C:\Users\ed does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

Environment data

Windows 10 Enterprise. Provide the output of $PSVersionTable fails with the same error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions