8000 Invoke-item fails when a space in the path · Issue #2900 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content
Invoke-item fails when a space in the path #2900
@rcw5

Description

@rcw5

I am running PowerShell on my Mac - there is an issue not fixed in 6.0.0 alpha 14 where invoke-item fails when there is a space in the path. It appears to treat the space as a separator as it attempts to open two paths instead of one.

Steps to reproduce

Create a file, /tmp/My Folder/test.txt

mkdir '/tmp/My Folder'
"Hello" | Out-File '/tmp/My Folder/test.txt' -Force

cd to that folder then call Invoke-Item

cd '/tmp/My Folder'
invoke-item ./test.txt

Expected behavior

Text file should open in TextEdit (at least on my Mac, although I expect default editors vary)

Actual behavior

Error written to PoSH console:

The files /tmp/My and /Users/rcw5/Folder/test.txt do not exist.

If you rename My Folder to MyFolder then invoke-item works as expected.

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.0-alpha
PSEdition                      Core
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
GitCommitId                    v6.0.0-alpha.14
CLRVersion
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0