Skip to content

Recent Move-Item changes causing Windows platform regressions #16000

@PaulHigin

Description

@PaulHigin

Prerequisites

Steps to reproduce

The recent change to Move-Item (PR #15077) is causing regressions on Windows platforms as reported by WSD.

The recent change of catching all IOException and retry is causing infinite recursion in some move cases.

I suggest we consider moving back to the original code that tries to detect (Windows platform code path) when MoveTo or CopyAndDelete should be used, and add additional error handling to that, if needed.

Expected behavior

cd c:\
mkdir 0
Move-Item  0 0
Move-Item : The process cannot access the file because it is being used by another process.
# Expected error is returned.

Actual behavior

cd c:\
mkdir 0
Move-Item 0 0
Ctrl+C
# Move-Item runs recursion indefinitely, continually creating '0' subdirectories.

Move-Item 0 0\1
Ctrl+C
# Move-Item runs recursion indefinitely, continually creating '1' subdirectories.

Error details

Unexpected error

Environment data

PSVersion                      7.2.0-preview.9
PSEdition                      Core
GitCommitId                    7.2.0-preview.9-14-g403767d7f7b910a6f315505287fe9a72c3960c52
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the product

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions