Skip to content

Conversation

@SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Aug 31, 2021

PR Summary

If Move fails, check if known case before attempting CopyAndDelete:

  • if an item is attempted to be renamed across filesystem mount boundaries.
  • if the source and destination do not have the same root path

PR Context

#15077 introduced a regression where it would fall through to CopyAndDelete on any IOException including where the destination doesn't exist (and probably other cases as well).

Fix #16000

PR Checklist

@SteveL-MSFT SteveL-MSFT requested a review from anmenaga as a code owner August 31, 2021 22:12
@ghost ghost assigned iSazonov Aug 31, 2021
Copy link
Contributor

@PaulHigin PaulHigin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@SteveL-MSFT
Copy link
Member Author

@iSazonov are you good with the changes?

@iSazonov iSazonov merged commit 5872e47 into PowerShell:master Sep 8, 2021
@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Sep 8, 2021
@iSazonov iSazonov added this to the 7.2.0-rc.1 milestone Sep 8, 2021
@iSazonov
Copy link
Collaborator

iSazonov commented Sep 8, 2021

I hope to discuss the issues with .Net team. Perhaps they will approve to enhance MoveTo() with copy-and-delete.

@SteveL-MSFT SteveL-MSFT deleted the move-item-2 branch September 8, 2021 16:01
TravisEz13 pushed a commit that referenced this pull request Sep 29, 2021
…ecific cases (#16029)

If Move fails, check if known case before attempting CopyAndDelete:

- if an item is attempted to be renamed across filesystem mount boundaries.
- if the source and destination do not have the same root path.
@ghost
Copy link

ghost commented Dec 16, 2021

🎉v7.3.0-preview.1 has been released which incorporates this pull request.:tada:

Handy links:

TrapGodBrim pushed a commit to TrapGodBrim/PowerShell that referenced this pull request Jan 19, 2022
…ecific cases (PowerShell#16029)

If Move fails, check if known case before attempting CopyAndDelete:

- if an item is attempted to be renamed across filesystem mount boundaries.
- if the source and destination do not have the same root path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-7.2.x-Done CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recent Move-Item changes causing Windows platform regressions

4 participants