New-Item throw "Could not find item {0}" #4520

Closed
opened 2026-01-30 23:49:35 +00:00 by claunia · 2 comments
Owner

Originally created by @JonasGao on GitHub (Oct 17, 2019).

Environment

Windows build number:

Platform ServicePack Version      VersionString
-------- ----------- -------      -------------
 Win32NT             10.0.18362.0 Microsoft Windows NT 10.0.18362.0
Windows Terminal version (if applicable):

Windows Terminal (Preview)
Version: 0.5.2762.0
PSVersionTable: 

Name                           Value
----                           -----
PSVersion                      7.0.0-preview.3
PSEdition                      Core
GitCommitId                    7.0.0-preview.3
OS                             Microsoft Windows 10.0.18362
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Steps to reproduce

# any dir
mkdir data
mkdir tool
New-Item -ItemType Junction -Path .\tool\data -Value .\data\

Expected behavior

create one link .\tool\data -> .\data\

Actual behavior

New-Item : Could not find item {0}.
At line:1 char:1
+ New-Item -ItemType Junction -Path .\tool\data -Value .\data\
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (.\data\:String) [New-Item], InvalidOperationException
+ FullyQualifiedErrorId : ItemNotFound,Microsoft.PowerShell.Commands.NewItemCommand
Originally created by @JonasGao on GitHub (Oct 17, 2019). # Environment ```none Windows build number: Platform ServicePack Version VersionString -------- ----------- ------- ------------- Win32NT 10.0.18362.0 Microsoft Windows NT 10.0.18362.0 ``` ``` Windows Terminal version (if applicable): Windows Terminal (Preview) Version: 0.5.2762.0 ``` ``` PSVersionTable: Name Value ---- ----- PSVersion 7.0.0-preview.3 PSEdition Core GitCommitId 7.0.0-preview.3 OS Microsoft Windows 10.0.18362 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0 ``` # Steps to reproduce ``` # any dir mkdir data mkdir tool New-Item -ItemType Junction -Path .\tool\data -Value .\data\ ``` # Expected behavior create one link .\tool\data -> .\data\ # Actual behavior ``` New-Item : Could not find item {0}. At line:1 char:1 + New-Item -ItemType Junction -Path .\tool\data -Value .\data\ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (.\data\:String) [New-Item], InvalidOperationException + FullyQualifiedErrorId : ItemNotFound,Microsoft.PowerShell.Commands.NewItemCommand ```
claunia added the Resolution-ExternalNeeds-Tag-Fix labels 2026-01-30 23:49:36 +00:00
Author
Owner

@carlos-zamora commented on GitHub (Oct 18, 2019):

This is a shell issue, not a terminal issue. This is because the commands you’re running are fully separate from the UI environment you’re in (so, not an issue with Terminal). And it’s not an issue with VT sequences (so, not an issue with ConPty). Please reach out to the Powershell team via their GitHub repo: https://github.com/PowerShell/PowerShell.

@carlos-zamora commented on GitHub (Oct 18, 2019): This is a shell issue, not a terminal issue. This is because the commands you’re running are fully separate from the UI environment you’re in (so, not an issue with Terminal). And it’s not an issue with VT sequences (so, not an issue with ConPty). Please reach out to the Powershell team via their GitHub repo: https://github.com/PowerShell/PowerShell.
Author
Owner

@JonasGao commented on GitHub (Oct 22, 2019):

Thank you for your reply. I will do it

@JonasGao commented on GitHub (Oct 22, 2019): Thank you for your reply. I will do it
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4520