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

Move-Item recursively creates "infinitely" nested directories #16089

Copy link
Copy link
@PAStheLoD

Description

@PAStheLoD
Issue body actions

Prerequisites

Steps to reproduce

mkdir test
cd test

mkdir abc
mv * abc

Don't forget to hit ctrl-c fast.

dir -Recurse t shows the created structure. I used 7zip File Manager to shift-del the nested dir structure.

Expected behavior

PS should not create the nested directory structure, it should ignore the target when expanding the wildcard into the source list, move everything else into the target directory.

In this example it should basically do a no-op, since there's nothing else to move into "abc".

Actual behavior

A directory that contains a directory, that contains a directory ... t\abc\abc\abc\abc ...

Environment data

PSVersion                      7.2.0-preview.9
PSEdition                      Core
GitCommitId                    7.2.0-preview.9
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
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

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    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.