Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Bad error message thrown when creating a symbolic link #3700

Copy link
Copy link
@daxian-dbw

Description

@daxian-dbw
Issue body actions

Steps to reproduce

## I intend to create a symbolic link `foo` pointing to the directory 'bar'.
## However, I incorrectly specified the target directory path as the argument to `-Path`.
mkdir F:\temp\bar
New-Item -ItemType SymbolicLink -Path F:\temp\bar -Value F:\temp\foo

Expected behavior

Error message should be meaningful and useful

Actual behavior

PS:62> New-Item -ItemType SymbolicLink -Path F:\temp\bar -Value F:\temp\foo
New-Item : NewItemIOError
At line:1 char:1
+ New-Item -ItemType SymbolicLink -Path F:\temp\bar -Value F:\temp\foo
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceExists: (F:\temp\bar:String) [New-Item], IOException
    + FullyQualifiedErrorId : NewItemIOError,Microsoft.PowerShell.Commands.NewItemCommand

Environment data

> $PSVersionTable
Name                           Value                                                               
----                           -----                                                               
PSVersion                      6.0.0-alpha                                                         
PSEdition                      Core                                                                
BuildVersion                   3.0.0.0                                                             
CLRVersion                                                                                         
GitCommitId                    v6.0.0-alpha.18-54-g3e416fb6422c0c25f63bd0228edd2403ae2c78d4        
OS                             Linux 4.8.0-41-generic #44~16.04.1-Ubuntu SMP Fri Mar 3 17:11:16 ...
Platform                       Unix                                                                
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                             
PSRemotingProtocolVersion      2.3                                                                 
SerializationVersion           1.1.0.1                                                             
WSManStackVersion              3.0              
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.