From 9a2a8096e4af9a3735d7dbb06ac3fa170190b479 Mon Sep 17 00:00:00 2001 From: Raimund Andree Date: Tue, 20 Oct 2026 14:07:32 +0000 Subject: [PATCH] test(items): cite the doc for the Move-Item2 -Force folder-replace comment Points the comment at Move-Item2.md's -Force and Notes sections, which document the overwrite as a replace, instead of only describing the probe that showed it. No test logic changed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: AI Assistant --- Tests/ParameterSets.Items.Tests.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/ParameterSets.Items.Tests.ps1 b/Tests/ParameterSets.Items.Tests.ps1 index ef6eca4..7805650 100644 --- a/Tests/ParameterSets.Items.Tests.ps1 +++ b/Tests/ParameterSets.Items.Tests.ps1 @@ -1053,10 +1053,10 @@ Describe 'Move-Item2 folder trees, in-place renames, and -Force' { } # Unlike Copy-Item2 -Force, which merges into an existing folder of the same name (ItemCmdlets.Tests.ps1:681), - # Move-Item2 -Force replaces it outright: run first with diagnostics instead of an assumed error (the - # destinationExists check of MoveItem2.cs is bypassed by -Force, since it is guarded by "!force"), the existing - # folder at the destination was gone afterwards, together with the file it held, and the moved folder took its - # place with no error, which this pins as observed. + # the cmdlet page documents that Move-Item2 -Force "overwrites an existing destination item" and runs with the + # ReplaceExisting option (Move-Item2.md, -Force and the Notes section); a non-empty folder at the destination + # confirms that this means a full replace, not a merge, which a probe showed first (the existing folder and the + # file it held were gone afterwards, and the moved folder took its place with no error). It 'Should replace an existing folder outright with -Force, not merge it, and write no error' { $sourceFolder = New-TestSandboxItem -Sandbox $sandbox -Name 'MoveForceFolderSource' -Directory $destinationParent = New-TestSandboxItem -Sandbox $sandbox -Name 'MoveForceFolderDestinationParent' -Directory