-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New-Item -Force does not have expected behavior for all types #17656
Copy link
Copy link
Closed
Labels
HacktoberfestPotential candidate to participate in HacktoberfestPotential candidate to participate in HacktoberfestIssue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module
Metadata
Metadata
Assignees
Labels
HacktoberfestPotential candidate to participate in HacktoberfestPotential candidate to participate in HacktoberfestIssue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module
Prerequisites
Steps to reproduce
Issue is
-Forcedoes not seem to understand junctions. It thinks they are directories and fails to remove them because they are not empty.Works fine with file types. (see screenshot)
Most types including registry entries allow
-Forceto overwrite the item. Logically-Forceshould do the same for a Junction.Due to
-Forcenot working you must firstRemove-Itemprior toNew-Item, which works perfectly fine.Remove-Itemsimply removes the junction and does not complain that it is not empty.New-Item -Forceneeds the same intelligence.Expected behavior
Actual behavior
Error details
Environment data
Visuals