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

Open
opened 2026-01-30 23:49:32 +00:00 by claunia · 0 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:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4516